Comments (8)
+1 This happens on the x86 interop whilst amd64 is fine. Wish I'd spotted this issue sooner as just spent 2 hours trying to debug it! Oh well :)
from dsinternals.
Sorry to hear that, Nathan. On the other hand, I am glad to hear that at least the amd64 version works for you and that other people actually compile the project from source code,because that was the purpose of releasing it at GitHub.
As you have spent some time going through the code, do you have aby suggestions to what could be improved? And do you perhaps have aby idea, why the x86 version fails with array size (?) exception on RPC call? I presume that it has something to do with compiler configuration / struct layout / INT64, because the codebase is the same, but I have not been successful in fixing it.
from dsinternals.
Actually I got the PowerShell cmdlet to work first as a simple proof of concept. Then I started playing with some F# script that called straight into the DSInternal.Replication to bypass all the PowerShell stuff and that's when I spotted the strange exception. I couldn't fathom why it was working via PowerShell but not via F# Interactive. Then I realised the only difference was that I was running it in PowerShell x64 versus F# Interactive x86. So I used FsiAnyCpu instead and then it all worked great.
It seems clear the issue is in the Interop library that you wrote in Managed C++ (is it called that?) but unfortunately I don't have any background in that. It is likely some IntPtr or equivalent pointer is not the right size for the word size. Have a scan through and make sure all the pointers you are using are correctly typed?
from dsinternals.
Other than that this is a really nice little library and PS module. We are looking at using it for a custom AD Users with Password Sync solution to our SaaS cloud service.
from dsinternals.
Is it worth ditching the interop library entirely and using PInvoke?
from dsinternals.
@nbevans Hell no!
- It contains thousands of lines of native C code generated by Microsoft's IDL compiler.
- RPC API relies heavily on pointer arithmetic and casting raw memory (void*) into structs, etc. Been there, tried that and implementing it in C# using PInvoke would be suicide.
I found an old version of my code that actually works on x86. It used a different architecture: All the RPC stuff was in its own C library that was statically linked into the C++ interop library. It seems that the problem has appeared during merging these 2 libraries. I will probably have to go through that process again and test each change, if it is the breaking one.
from dsinternals.
Fair enough :)
from dsinternals.
Fantastic :) Thank you!
from dsinternals.
Related Issues (20)
- DSInternals.Replication.Interop.dll - File not found Exception on .NET 7/Core HOT 1
- ERROR: Package 'dsinternals' requires a different Python: 2.7.18 not in '>=3.4' HOT 1
- Unable to find pekList column Id? HOT 5
- Performance on very large databases? HOT 1
- Set-ADDBCompatibility HOT 1
- Extract users from specific OU or CN using DSInternals.Replication HOT 1
- Cmdlet for offline user unlock
- Password in plain text is missing HOT 1
- Modified Get-ADDBAccount to include more attributes : Object reference not set to an instance of an object. HOT 2
- Password Quality Result HOT 2
- Troubleshooting
- Memory consumption when running Get-ADDBAccount command HOT 1
- Get-ADReplAccount : The input is shorter than the minimum length. HOT 8
- DSInternals.Common.dll: Could not load file or assembly
- copied the database back to the original DC HOT 2
- Domain reference for Format-Custom views HOT 2
- Remove-ADDBObject : doesn't remove objects HOT 1
- Get-ADDBAccount - There was a problem reading the Database which probably comes from a different OS HOT 1
- Add-ADDBSidHistory / There was a problem reading the database, which probably comes from a different OS / After Exchange 2019 Schema Update HOT 8
- the prefixEntry 9478 has a length of 0 in the for loop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dsinternals.