网站首页  词典首页

请输入您要查询的函数:

 

术语 writeprocessmemory
释义 WriteProcessMemory
语法:
C++
BOOL WINAPI WriteProcessMemory(
__in HANDLE hProcess,
__in LPVOID lpBaseAddress,
__in LPCVOID lpBuffer,
__in SIZE_T nSize,
__out SIZE_T *lpNumberOfBytesWritten
);
WriteProcessMemory的功能
写入数据的内存区域中指定的进程。整个地区被写入到必须能够访问或操作失败。
参数
hProcess [in]
句柄的进程的内存进行修改。句柄必须PROCESS_VM_WRITE和PROCESS_VM_OPERATION访问进程。
lpBaseAddress [in]
向指定进程的数据写入基址指针。之前的数据传输时,系统验证,在基址和指定大小的内存的所有数据进行写访问方便,如果不能访问,函数失败。
lpBuffer [in]
一个缓冲区,它包含要在指定的进程的地址空间写入的数据指针。
nSize [in]
的字节数被写入到指定的进程。
lpNumberOfBytesWritten [out]
一个变量,它接收到指定的过程中传输的字节数的指针。此参数是可选的。如果lpNumberOfBytesWritten为NULL,则参数被忽略。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值为0(零)。为了获得更多错误信息,调用GetLastError。函数失败如果要求写操作是无法跨越到该进程的一个领域。
备注
WriteProcessMemory的副本从当前进程指定的缓冲区的数据到指定的进程的地址范围。任何进程,有一个与PROCESS_VM_WRITE和PROCESS_VM_OPERATION访问进程句柄写入可以调用该函数。通常但不总是,与地址空间正在写入进程正在调试。
整个地区被写入到必须方便,如果不能访问,函数失败。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
调试功能
工艺调试功能
ReadProcessMemory的
VirtualAllocEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==WriteProcessMemory Function
Writes data to an area of memory in a specified process. The entire area to be written to must be accessible or the operation fails.
Syntax
C++
BOOL WINAPI WriteProcessMemory(
__in HANDLE hProcess,
__in LPVOID lpBaseAddress,
__in LPCVOID lpBuffer,
__in SIZE_T nSize,
__out SIZE_T *lpNumberOfBytesWritten
);
Parameters
hProcess [in]
A handle to the process memory to be modified. The handle must have PROCESS_VM_WRITE and PROCESS_VM_OPERATION access to the process.
lpBaseAddress [in]
A pointer to the base address in the specified process to which data is written. Before data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for write access, and if it is not accessible, the function fails.
lpBuffer [in]
A pointer to the buffer that contains data to be written in the address space of the specified process.
nSize [in]
The number of bytes to be written to the specified process.
lpNumberOfBytesWritten [out]
A pointer to a variable that receives the number of bytes transferred into the specified process. This parameter is optional. If lpNumberOfBytesWritten is NULL, the parameter is ignored.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError . The function fails if the requested write operation crosses into an area of the process that is inaccessible.
Remarks
WriteProcessMemory copies the data from the specified buffer in the current process to the address range of the specified process. Any process that has a handle with PROCESS_VM_WRITE and PROCESS_VM_OPERATION access to the process to be written to can call the function. Typically but not always, the process with address space that is being written to is being debugged.
The entire area to be written to must be accessible, and if it is not accessible, the function fails.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Debugging Functions
Process Functions for Debugging
ReadProcessMemory
VirtualAllocEx
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms681674(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:29:19