编译通不过,报:
error C2664: 'WriteProcessMemory' : cannot convert parameter 3 from 'const void *' to 'void *'
查看对应的MSDN(2001),发现函数原型是对的呀
BOOL WriteProcessMemory(
HANDLE hProcess, // handle to process
LPVOID lpBaseAddress, // base of memory area
LPCVOID lpBuffer, // data buffer
SIZE_T nSize, // count of bytes to write
SIZE_T * lpNumberOfBytesWritten // count of bytes written
);
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
WINBASEAPI
BOOL
WINAPI
WriteProcessMemory(
IN HANDLE hProcess,
IN LPVOID lpBaseAddress,
IN LPCVOID lpBuffer,
IN SIZE_T nSize,
OUT SIZE_T * lpNumberOfBytesWritten
);
以前也发现过一个bug:
原版的VC6:
BOOLAPI
GetUrlCacheEntryInfoW(
IN LPCSTR lpszUrlName,
OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
);
2003年2月SDK已经修正:
URLCACHEAPI_(BOOL) GetUrlCacheEntryInfoW(
IN LPCWSTR lpszUrlName,
OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
);