I am trying to make use of RegenerateUserEnvironment method so that I can refresh environment variables without restarting the instance. However, it e ...
I am trying to make use of RegenerateUserEnvironment method so that I can refresh environment variables without restarting the instance. However, it e ...
I generated bindings for a native library but realized that imports differ between 32-bit and 64-bit. Problem: Not only the entry point differ, but ...
None of the methods in Unsafe class do work when trying to read a structure from a pointer. They all display Unable to read memory in the debugger: ...
I have this c++ header: // BRepPrimAPI_MakeSphere.hxx file #include <Standard.hxx> #include <Standard_DefineAlloc.hxx> #include <BRepP ...
Can't figure out what's the issue with CreateFilePrivate. called from PowerShell, with: Edited with fixes for issues pointed out by @Dai. ...
I've had some success with p-Invoking some API functions, but now something seemingly simple has me stumped. This code works: Output and test: ...
In one module, I created a dictionary and convert to IntPtr (for PInvoke call). In another module, I get the dictionary object from IntPtr, which is ...
I'm having trouble with the shape of a struct to pass to an NVML Library function via pinvoke. The struct contains a fixed size array and some unsigne ...
I have a C# (NET 6) project where I try to call fortran subroutine and passing a struct. I have made simplified version here: c#: and the FortranL ...
I'm p/invoking InternetSecurityManager.GetZoneMappings() in order to get a list of safe sites from my Intranet Zone, and the Next() method on the retu ...
Please excuse me if my terminology isn't correct I am new to P/Invoke & marshalling. I am trying to execute the NtQuerySystemInformation method fr ...
I've tried a few different ways, just can't seem to get it working completely right. This is the exception I'm getting now. I'm having trouble fi ...
I am trying to read the value of ImageBaseAddress in the PEB of a process I have created using Win32 API calls in C# with P/Invoke. However the call t ...
I have a .Net 4.6 C# GUI app that uses a native DLL. I would like to process data in the native code and return memory allocated on the native side ba ...
Suppose a C library (let's call it mylib.so) exposes the following: typedef void (*EventCallback)(int); // there would be an additional declspec mac ...
How can I using Dllimport by C# to get string array from C library I have try StringBuilder[] and many of MarshalAsAttributes to receive ClassNames ...
According to the documentation, when trying to call unmanaged code in my managed code, it should has the exact same function signature as the unmanage ...
All of the SI fields are 0 after the call to GetSystemInfo in the code below, that's the issue I am trying to solve here. This is about the same code ...
I have a C++ DLL with an exported function: This function allocate buffer array and assign value for test The struct DataBufferIn is like this ...
I'm using RegisterShellHookWindow to detect user interaction on windows. In my WndProc I get the message code: 0xC029. I looked in WinUser.h but noth ...