Skip to content

Latest commit

 

History

History
152 lines (113 loc) · 6.33 KB

nf-psapi-getwschanges.md

File metadata and controls

152 lines (113 loc) · 6.33 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:psapi.GetWsChanges
GetWsChanges function (psapi.h)
Retrieves information about the pages that have been added to the working set of the specified process since the last time this function or the InitializeProcessForWsWatch function was called.
GetWsChanges
GetWsChanges function [PSAPI]
K32GetWsChanges
_win32_getwschanges
base.getwschanges
psapi.getwschanges
psapi.h/K32GetWsChanges
psapi/GetWsChanges
psapi/K32GetWsChanges
psapi\getwschanges.htm
psapi
ace5106c-9c7b-4d5f-a69a-c3a8bff0bb2d
12/05/2018
GetWsChanges, GetWsChanges function [PSAPI], K32GetWsChanges, _win32_getwschanges, base.getwschanges, psapi.getwschanges, psapi.h/K32GetWsChanges, psapi/GetWsChanges, psapi/K32GetWsChanges
psapi.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Kernel32.lib on Windows 7 and Windows Server 2008 R2; Psapi.lib (if PSAPI_VERSION=1) on Windows 7 and Windows Server 2008 R2; Psapi.lib on Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP
Kernel32.dll on Windows 7 and Windows Server 2008 R2; Psapi.dll (if PSAPI_VERSION=1) on Windows 7 and Windows Server 2008 R2; Psapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP
Windows
19H1
GetWsChanges
psapi/GetWsChanges
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
Psapi.dll
Psapi.dll
API-MS-Win-Core-PsAPI-L1-1-0.dll
KernelBase.dll
GetWsChanges
K32GetWsChanges

GetWsChanges function

-description

Retrieves information about the pages that have been added to the working set of the specified process since the last time this function or the InitializeProcessForWsWatch function was called.

To retrieve extended information, use the GetWsChangesEx function.

-parameters

-param hProcess [in]

A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see Process Security and Access Rights.

-param lpWatchInfo [out]

A pointer to a user-allocated buffer that receives an array of PSAPI_WS_WATCH_INFORMATION structures. The array is terminated with a structure whose FaultingPc member is NULL.

-param cb [in]

The size of the lpWatchInfo buffer, in bytes.

-returns

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

GetLastError returns ERROR_INSUFFICIENT_BUFFER if the lpWatchInfo buffer is not large enough to contain all the working set change records; the buffer is returned empty. Reallocate a larger block of memory for the buffer and call again.

-remarks

The operating system uses one buffer per process to maintain working set change records. If more than one application (or multiple threads in the same application) calls this function with the same process handle, neither application will have a complete accounting of the working set changes because each call empties the buffer.

The operating system does not record new change records while it is processing the query (and emptying the buffer). The function sets the error code to NO_MORE_ENTRIES if a concurrent query is received while it is processing another query.

If the buffer becomes full, no new records are added to the buffer until this function or the InitializeProcessForWsWatch function is called. You should call this method with enough frequency to prevent possible data loss. If records are lost, the array is terminated with a structure whose FaultingPc member is NULL and whose FaultingVa member is set to the number of records that were lost.

Windows Server 2003 and Windows XP:  If records are lost, the array is terminated with a structure whose FaultingPc member is NULL and whose FaultingVa member is 1.

Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI version number affects the name used to call the function and the library that a program must load.

If PSAPI_VERSION is 2 or greater, this function is defined as K32GetWsChanges in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetWsChanges in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetWsChanges.

Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as GetWsChanges. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.

-see-also

EnumProcesses

InitializeProcessForWsWatch

PSAPI Functions

PSAPI_WS_WATCH_INFORMATION

Working Set Information