kernel32

Wrapper C# for kernel32.dll API

浪子不回头ぞ 提交于 2019-12-04 05:56:45
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("kernel32.dll", EntryPoint = "OpenProcess")] public static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId); [DllImport("kernel32", CharSet = CharSet.Ansi)] public extern static int GetProcAddress(int hwnd, string procedureName); [DllImport("kernel32

Unresolved external symbols in compiling 32 bit application in Windows 64

随声附和 提交于 2019-12-03 11:49:58
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 weird undefined symbol errors: error LNK2019: unresolved external symbol InterlockedDecrement referenced in function ... error LNK2019: unresolved external symbol InterlockedIncrement referenced in function ... error LNK2019: unresolved external symbol

How to get the “Application Name” from hWnd for Windows 10 Store Apps (e.g. Edge)

老子叫甜甜 提交于 2019-12-03 08:11:08
I'm trying to get an understandable "Process Name" for Windows 10 apps. Currently, all of them use ApplicationFrameHost , so I thought I could use either the ModelId or the PackageName , but it seems Windows 10 Store Apps (I tried with Mail , Store and Edge ) won't work with the Package query API Using kernel32.dll , GetApplicationUserModelId returns APPMODEL_ERROR_NO_APPLICATION and GetPackageId returns APPMODEL_ERROR_NO_PACKAGE . How can I get an identifier for a Windows 10 Store App, so that I can uniquely identify, say, Edge but also any other Windows 10 Store Apps? Update I'm getting the

Adding another method to JNA Class Java (Kernel32)

别说谁变了你拦得住时间么 提交于 2019-12-02 07:23:56
问题 I was trying to use a method from WIN32 dll, not included in JNA. The Method is GetProductInfo I try this in separate project and work: public interface Kernel32 extends Library { public boolean GetProductInfo(int dwOSMajorVersion,int dwOSMinorVersion, int dwSpMajorVersion, int dwSpMinorVersion, IntByReference pdwReturnedProductType); } Using.. Kernel32 lib = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class); IntByReference dwType = new IntByReference(); lib.GetProductInfo(6,0,0,0

Unable to find an entry point named 'InterlockedIncrement' in DLL 'kernel32.dll' - VS2005@Win7 64 bit

陌路散爱 提交于 2019-12-02 00:56:55
问题 I have a problem with my Visual Studio 2005 C# project. I have been using it under Windows XP, since Monday. Then my laptop broke down and on my new one I have Windows 7 64 bit and I am still using VS 2005. There is no problem with compilation of the source, but when I run the program it breaks on the line below OdbcConnection cn; cn = new OdbcConnection("dsn=My_dsn_name;"); I get the error: EnrtyPointNotFoundExcepition was unhalted Unable to find an entry point named 'InterlockedIncrement'

error cannot open file 'kernel32.lib'

柔情痞子 提交于 2019-12-01 15:09:31
问题 I have installed VS2013 and VS2015 on Windows 7. I have an existing C++ Dll project that was building fine but now all of a sudden it wont build using VS2015 and gives me the error: LINK : fatal error LNK1104: cannot open file 'kernel32.lib' From this post: fatal error LNK1104: cannot open file 'kernel32.lib' I went looking for the kernel32.lib file and it is located here: C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86 When I go to my Projects Properties-->Linker-->Input and

Why does GetFileVersionInfo on kernel32.dll in Windows 10 return version 6.2?

感情迁移 提交于 2019-11-30 22:53:08
I am trying to retrieve kernel32.dll version in order to perform a Windows version check. Yet, for some reason, even though kernel32.dll 's version (as seen in file properties) is 10.0.10586.0, the returned version is: 6.2.10586.0 how come? DWORD dwDummy; DWORD dwFVISize = GetFileVersionInfoSize(lpszFilePath, &dwDummy); LPBYTE lpVersionInfo = new BYTE[dwFVISize]; if (GetFileVersionInfo(lpszFilePath, 0, dwFVISize, lpVersionInfo) == 0) { return FALSE; } UINT uLen; VS_FIXEDFILEINFO *lpFfi; BOOL bVer = VerQueryValue(lpVersionInfo, L"\\", (LPVOID *)&lpFfi, &uLen); if (!bVer || uLen == 0) { return

ReadProcessMemory fails on some Pages (GetLastError()=299)

谁都会走 提交于 2019-11-30 16:01:39
I try to read all commited pages of a process (Win7-64). On most pages it works but it fails for a few pages. I cannot explain why. Here is my test programme (compiled x32, tested in Win7-64): #include <windows.h> void main() { HANDLE hProc = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION,FALSE,GetCurrentProcessId()); SYSTEM_INFO si; ZeroMemory(&si,sizeof(SYSTEM_INFO)); GetSystemInfo(&si); char* buf = new char[si.dwPageSize]; for (unsigned i = 0; i < 0x7fff0; i++) { void* baseOffs = (void*) (i * si.dwPageSize); MEMORY_BASIC_INFORMATION mbi; ZeroMemory(&mbi,sizeof(MEMORY_BASIC

CreateProcess such that child process is killed when parent is killed?

浪尽此生 提交于 2019-11-30 11:33:37
Is there a way to call CreateProcess such that killing the parent process automatically kills the child process? Perhaps using Create Process Flags ? Edit The solution is to create a job object, place both parent and child in the job object. Whent he parent is killed the child is killed. I got the code from here: Kill child process when parent process is killed Take note of @wilx's comment about inherited handles. wilx Using jobs as Neil says is IMHO the best way. You can make the child processes get killed when the job owning process dies by setting JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE on the

CreateProcess such that child process is killed when parent is killed?

女生的网名这么多〃 提交于 2019-11-29 16:58:37
问题 Is there a way to call CreateProcess such that killing the parent process automatically kills the child process? Perhaps using Create Process Flags? Edit The solution is to create a job object, place both parent and child in the job object. Whent he parent is killed the child is killed. I got the code from here: Kill child process when parent process is killed Take note of @wilx's comment about inherited handles. 回答1: Using jobs as Neil says is IMHO the best way. You can make the child