kernel32

Is there a managed API for kernel32.searchpath?

Is there a managed API for kernel32.searchpath? i.e not using a pinvoke. http://www.pinvoke.net/default.aspx/kernel32.searchpath ...

Wrapper C# for kernel32.dll API

Any helper class anywhere which wrapps kernel32 APIs, with all functions-methods and structures? Or any wrapper generator? I want ALL methods of kernel32.dll in C# like this: [DllImport("kernel32.dll",EntryPoint="RtlMoveMemory")] public static extern void RtlMoveMemory(int des, int src, int count); [DllImport("kernel3...

Weird exception when trying to DllImport from kernel32

Hello! I have been using this particular function for months now, however today it stopped working. I can't imagine why, and I'm ruling nothing out, so if you have any ideas please do tell! I am loading function in such manner: [DllImport("kernel32")] private static extern int GetPrivateProfilestring(string section, string key, string...

Low-Level C++ App Crashes on Windows Vista/7 Unless Run in XP Compatibility Mode

Hi, I have a low-level (like really low-level, it's basically all IOCTL calls and several calls to enumeration APIs) that crashes sporadically on Windows Vista/7 on clients' machines. Unfortunately, I have not been able to procure any crash dumps but one helpful user did mention that running the program in XP Compatibility Mode solved t...

Why does my windows console application leak when idling? (And why does the smoking gun point at kernel32.dll??)

Hello everyone. I have a windows multi-threded console application that appears to be leaking approximately 4kb private memory every minute or so. In an effort to localise the leak, I have gradually suspended each thread in the application until the leak stopped, and to my surprise the culprit seems to be a thread named "Win32Thread". ...

How to get Directory information via Windows native API?

I can get the created date, file size etc for a file using the following code: // Error handling removed for brevity HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); LARGE_INTEGER fileSize; GetFileSizeEx(hFile, &fileSize); FILE_BASIC_INFO fileInfo); Ge...

lstrcpy not updating passed in string

I'm trying to use kernel32.dll's lstrcpy to get a string from a pointer in C#, but it isn't working. lstrlenA IS working, it gives me the length of the string, so I'm hitting the kernel32.dll at least. lstrcpy is working in the VB6 app I'm converting, so I know it CAN work, but I don't have a clue why it isn't here. The string s never g...

C# - Possible to use IOCTL

I'm trying to code for a Point Of Sale system which allows for a "Cash Drawer" attachment. Code is provided in the manual for opening the cash drawer (in C++ using IOCTL). Since I am coding in C# .NET, is it possible to perform something similar from within C# or will I have to write some unmanaged code? Am I able to get a handle to "...

how to get Processor ID using Kernel32.dll

Hi, I want to know if there is an Entry point for kernel32.dll , that is related to any processor data (ID , Serial , etc ... ) and I tried to Google it but I didn't find good results . Note: I already know WMI , but I need something related to Kernel ! ...

How do you call Win32 API functions from inline assembler?

Would somebody please tell me whats wrong with this code I am just calling a Sleep function from the kernel32.dll What's wrong? I am using Visual Studio 2008. Any help would be grateful. Thank you very much. __asm { mov eax, 77e2ef66h push 9999 call eax } ...

Sleeping in VBA (Integer Overflow!!)

In VBA you can Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) to provide yourself with a sleep routine. However, the Long that must be passed to the routine appears to overflow for values in excess of 32000 milliseconds. Is there a way to sleep for longer periods of time without the complexity of stringing together s...

what is the difference between ZwOpenFile and NtOpenFile?

ZWOpenFile and NtOpenFile are both the functions of nt dll..ZwOpenFile is implemented as same as NtopenFile..but I dont understand why ZWopenFile is included in nt dll function.Can anyone please explain me the difference? ...

Application error: fault address 0x00012afb (Expert)

Hi, I need some "light" to get a solution. Probably there are tons of things that cause this problem, but maybe somebody could help me. Scenario: a Windows server running 24/7 a PostgreSQL database and others server applications (for processing tasks on database, etc...). There are differents servers scenarios (~30), with different har...

status failed for LdrLoadDll

hello all,I'am trying to work-out the LdrLoadDll function and am having no luck with that..i also googled for some examples there is no much documentation or correct example about this.I know what it exactly does..Please check the code below. //declaration function pointer for LdrLoadDll typedef NTSTATUS (_stdcall*fp_LdrLoadDll)( IN PW...

Why does handling cancel closing make my .NET application crash?

I used the answer from this thread: http://stackoverflow.com/questions/474679/capture-console-exit-c Whenever I close the console, I get a "--- has stopped working." from Windows 7. Any idea? ...

Finding the attributes of Chinese filenames using NewLISP?

The following NewLISP code shows me the file attributes of files under Win32. However, some of the filenames retrieved have Chinese characters in the name. When the GetFileAttributesA function encounters them, it gives me a -1 for the attribute. I looked at GetFileAttributesW but don't know how to make the contents of the fname available...

Unresolved external symbols in compiling 32 bit application in Windows 64

So I am trying to compile legacy app from 32 bit to 64 bit.. I re-compiled all of the libs it used and made it look into WIN SDK6.0A x64 bit for libs.. I am using: Visual Studio Professional Edition 2008 Visual C++ dotNet Framework 3.5 SP1 Windows Server 2008R2 Windows SDK is 6.0A Everythings finally coming up but I am getting these...

Example of System call

Where can you find a list or example of system calls which execute in kernel mode on Windows NT 5.1? ...

Getting Architecture of Windows (32/64 bit version)

Hey i got a little problem: im tring to get the architecture of the OS, the problem is my programming language doesnt support such functions. Therefore i need to read this information form an windows dll (like kernel32.dll) i did try to get the infos with the functions GetNativeSystemInfo/GetVersionEx/GetSystemInfo. Unfortunately i wer...

C# EntryPointNotFoundException Unable to find an entry point named 'SetDllDirectory' in DLL 'kernel32.dll'.

I am trying to use several functions from kernal32.dll. However, when my application tries to call the first function it throws an EntryPointNotFoundException Unable to find an entry point named 'SetDllDirectory' in DLL 'kernel32.dll'. public class MyClass { /// <summary> /// Use to interface to kernel32.dll for dynamic loading...