1 out of 1 rated this helpful - Rate this topic

EnumPageFiles function

Applies to: desktop apps only

Calls the callback routine for each installed pagefile in the system.

Syntax

BOOL WINAPI EnumPageFiles(
  __out  PENUM_PAGE_CALLBACK pCallbackRoutine,
  __in   LPVOID lpContext
);

Parameters

pCallbackRoutine [out]

A pointer to the routine called for each pagefile. For more information, see EnumPageFilesProc.

lpContext [in]

The user-defined data passed to the callback routine.

Return value

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

Remarks

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 K32EnumPageFiles in Psapi.h and exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumPageFiles in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EnumPageFiles.

Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as EnumPageFiles. 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.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Psapi.h

Library

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

DLL

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

Unicode and ANSI names

EnumPageFilesW (Unicode) and EnumPageFilesA (ANSI)

See also

EnumPageFilesProc
PSAPI Functions

 

 

Send comments about this topic to Microsoft

Build date: 2/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
EnumPageFiles is not in Windows 2000 Professional
The current documentation reports the minimum supported client as Windows 2000 Professional. The EnumPageFiles function does not exist in the Windows 2000 Professional SP4 version of psapi.dll. The minimum supported client is Windows XP. It it likely this does not exist in Windows 2000 Server either and that the minimum supported server is Windows Server 2003.