Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-ODStatusFromDLL Error #15

Open
aakash-shah opened this issue Mar 22, 2024 · 7 comments
Open

Get-ODStatusFromDLL Error #15

aakash-shah opened this issue Mar 22, 2024 · 7 comments

Comments

@aakash-shah
Copy link

Hello! I am able to use and run Get-ODStatus. But in case you need feedback/testing for Get-ODStatusFromDLL, FYI I get this error when attempting to run it on Win11 23H2 on one of my computers:

PS D:\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: ulong
MethodInvocationException: D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42
Line |
  42 |      $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "GetODSyncStatus" with "4" argument(s): "Value cannot be null. (Parameter 'path1')"
Write-Error: Call to GetODSyncStatus failed. HRESULT:
Write-Error: Size: 0

            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size

And on a second Win11 23H2 computer, I get a few more errors:

PS D:\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: uint64
Exception calling "GetODSyncStatus" with "4" argument(s): "Unable to load DLL 'ODSyncLib.dll': The specified module could not be found. (Exception from HRESULT:
0x8007007E)"
At D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42 char:5
+     $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DllNotFoundException

D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Call to GetODSyncStatus failed. HRESULT:
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

D:\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Size: 0
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1


            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size
@rodneyviana
Copy link
Owner

You have to run it from the same folder where ODSyncLib.dll is located or provide the full path.

@aakash-shah
Copy link
Author

Hello @rodneyviana! I am running this from the same folder but I continue to get this error. Here is some additional information. Let me know if you'd like me to test/do something else, or if I am running this incorrectly:

PS C:\Folder\ODSyncUtil-64-bit> .\Get-ODStatusFromDLL.ps1
MaxSize: 4096 / Type: uint64
Exception calling "GetODSyncStatus" with "4" argument(s): "Unable to load DLL 'ODSyncLib.dll': The specified module could not be found. (Exception from HRESULT:
0x8007007E)"
At C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1:42 char:5
+     $HRESULT = [ODSyncLib]::GetODSyncStatus($IgnoreQuota, $Result, $M ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DllNotFoundException

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Call to GetODSyncStatus failed. HRESULT:
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1

C:\Folder\ODSyncUtil-64-bit\Get-ODStatusFromDLL.ps1 : Size: 0
At line:1 char:1
+ .\Get-ODStatusFromDLL.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ODStatusFromDLL.ps1


            Status = "Error"
            HRESULT = $HRESULT
            Size = $Size

PS C:\Folder\ODSyncUtil-64-bit> dir


    Directory: C:\Folder\ODSyncUtil-64-bit


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         3/21/2024  12:22 PM          15631 Get-ODStatus.ps1
-a----         3/21/2024  12:31 PM          16629 Get-ODStatusFromDLL.ps1
-a----         3/21/2024   2:10 PM          57032 ODSyncLib.dll
-a----         3/21/2024   2:07 PM       12488704 ODSyncLib.pdb
-a----         3/21/2024   2:09 PM          79560 ODSyncUtil.exe
-a----         3/21/2024   2:07 PM       12824576 ODSyncUtil.pdb


PS C:\Folder\ODSyncUtil-64-bit> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.3958
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.3958
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

@rodneyviana
Copy link
Owner

rodneyviana commented Aug 23, 2024 via email

@aakash-shah
Copy link
Author

Yes, the EXE and Get-ODStatus.ps1 work with no issues. I was just reporting that Get-ODStatus.ps1 didn't work for me in case you needed feedback on it (I'm good with just Get-ODStatus.ps1).

Thanks.

@rodneyviana
Copy link
Owner

Yes, the EXE and Get-ODStatus.ps1 work with no issues. I was just reporting that Get-ODStatus.ps1 didn't work for me in case you needed feedback on it (I'm good with just Get-ODStatus.ps1).

Thanks.

Glad ODSync is working as exe. If you want to continue troubleshooting the DLL

@aakash-shah
Copy link
Author

aakash-shah commented Aug 23, 2024

ProcMon revealed it going through all of the paths in my Path variable and being unable to find ODSyncLib.dll. After temporarily adding the folder to my Path environment variable and trying it in a new PS window, it works.

So it looks like it's a bug that isn't correctly reading the DLL file from the current folder path.

@aakash-shah
Copy link
Author

aakash-shah commented Aug 28, 2024

@rodneyviana Hello! No rush at all, but can you please re-open this so that it remains on your to do list since it has been closed out.
Thanks!

@rodneyviana rodneyviana reopened this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants