Git Product home page Git Product logo

Comments (8)

nbevans avatar nbevans commented on August 20, 2024

+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.

MichaelGrafnetter avatar MichaelGrafnetter commented on August 20, 2024

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.

nbevans avatar nbevans commented on August 20, 2024

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.

nbevans avatar nbevans commented on August 20, 2024

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.

nbevans avatar nbevans commented on August 20, 2024

Is it worth ditching the interop library entirely and using PInvoke?

from dsinternals.

MichaelGrafnetter avatar MichaelGrafnetter commented on August 20, 2024

@nbevans Hell no!

  1. It contains thousands of lines of native C code generated by Microsoft's IDL compiler.
  2. 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.

nbevans avatar nbevans commented on August 20, 2024

Fair enough :)

from dsinternals.

nbevans avatar nbevans commented on August 20, 2024

Fantastic :) Thank you!

from dsinternals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.