unmanaged

Listing functions of an unmanaged DLL at runtime in c#

泄露秘密 提交于 2019-12-11 04:11:58
问题 Is it possible to obtain a list of functions declared in an unmanaged DLL? I want to create this list in a c# program. Using dumpbin or System.Reflection.Assembly is not possible. Thanks 回答1: As far as I know, the only way you can do this either: Use a utility (such as dumpbin) and analyse its output from your C# code. Open the target DLL file and manually work out where the export section of the file is located and read that. You might need the help of too like PE Explorer or similar to help

Calling un-managed code with pointer

淺唱寂寞╮ 提交于 2019-12-11 04:09:13
问题 I have a C# project that makes calls out to an unmanaged C++ dll. The wrapper and most of the calls are working OK, so I know that I have the basic structure of how everything ties together OK, but there is one specific call that is giving me fits. The API call requires a pointer to a structure, which contains a list of configuration data. Here is the call: m_status = m_XXXXBox.SetConfig(m_channelId, ref SCONFIG_LIST); Where SCONFIG_LIST is the structure containing the data... The issue

unmanaged win32 dll not loading in .net MVC app on IIS 8.5, Win Server 2012 R2, Azure virtual machine

白昼怎懂夜的黑 提交于 2019-12-11 03:58:25
问题 I am trying to consume a win32 DLL in a .net MVC app. However I keep getting the following error Unable to load DLL 'experiment_dll.dll': The specified module could not be found I have used Process Monitor to capture file system activity when the code trying to load the DLL executes. It shows that the DLL can be seen and most of the file system operations are a success. Two full size screen captures of file system activity - Screencapture 1 Screencapture 2 As you can see one of the results of

C# Managed Unmanaged code

微笑、不失礼 提交于 2019-12-11 03:39:19
问题 I'm trying to understand managed/unmanaged code as it pertains to structs and classes. I have a struct with a property of another struct but its a pointer declaration as in: struct StateInfo { Bitboard board; StateInfo* previous; } I'm converting a C++ project to C#. Anyways, this doesn't work because Bitboard is a class. The error I get is something to the fact that pointers cannot be declared on managed types. If I take out Bitboard from the struct, it's fine. I need it though so I changed

Memory allocation profilers for managed and unmanaged code? [closed]

夙愿已清 提交于 2019-12-11 03:17:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . My application runs a combination of C++ (COM objects) and C# managed code. Sadly there is a n elusive memory leak I need to trace down. I've tried AQTime, which looked good on paper, but my app keeps crashing when running underneath it. Any suggestion for a better alternative? 回答1: Massif is a heap analyzer,

C# Get list of handles, AcessViolationException

时光怂恿深爱的人放手 提交于 2019-12-11 02:37:46
问题 Info: .Net 4.5 Tested on: Win7 64 bit Win10 64 bit (Virtual Box) I am trying to get a list of handles of an external process and return their names as string so I can close a specific one afterwards. Therefore i wrote this function using the Win32API which will check if the handle is the handle i want to close: ` const int CNST_SYSTEM_HANDLE_INFORMATION = 16; const uint STATUS_INFO_LENGTH_MISMATCH = 0xc0000004; public static string getObjectTypeName(Win32API.SYSTEM_HANDLE_INFORMATION shHandle

How to set the culture info in unmanaged C++?

◇◆丶佛笑我妖孽 提交于 2019-12-11 02:24:27
问题 I got a program written in unmanaged C++, I need to get the cultural info from the system and set that info to the current execution thread in my c++ application. Thanks. 回答1: In unmanaged C++ on windows, what you need is the Locale. Culture is a term defined in .NET, as a replacement for that term. There's a whole host of functions, but the one where you need to start is called SetThreadLocale. SetThreadLocale Function (Windows) @ MSDN Within the documentation at MSDN, it appears that there

GetKeyboardLayoutName of other process?

早过忘川 提交于 2019-12-11 01:18:41
问题 Basically, what I am trying to do is to have GetKeyboardLayoutName return the keyboard ID (KLID) of other processes. By default, it retruns only the keyboard ID for my app window. I tried also GetKeyboardLayout but it returns a HKL unfortunetly (it accepts a hwnd of other another window). Or, if there is a way of converting an HKL to KLID, it would be great too, but I doubt there is such a thing. So, how can I achieve this? I want to be able to use the obtained KLID as a parameter of the

How to convert a unmanaged double to a managed string?

假装没事ソ 提交于 2019-12-10 21:57:11
问题 From managed C++, I am calling an unmanaged C++ method which returns a double. How can I convert this double into a managed string? 回答1: I assume something like (gcnew System::Double(d))->ToString() 回答2: C++ is definitely not my strongest skillset. Misread the question, but this should convert to a std::string, not exactly what you are looking for though, but leaving it since it was the original post.... double d = 123.45; std::ostringstream oss; oss << d; std::string s = oss.str(); This

What is the effect of setting (or not) .NET CLR version in ASP.Net Core?

陌路散爱 提交于 2019-12-10 20:10:47
问题 What is the point of setting "No Managed Code" .NET CLR version for an IIS Asp.NET Core application pool? Documentation says that ASP.NET Core runs in a separate process and manages the runtime. ASP.NET Core doesn't rely on loading the desktop CLR. Setting the .NET CLR version to No Managed Code is optional . Since it is optional , what are the drawbacks of keeping the default v4.0 ? Why the documentation explicitly instructs to set it to "No Managed Code"? It's not very clear whether there