add pagefile at runtime

  • Thread starter Thread starter Ann Adamson
  • Start date Start date
A

Ann Adamson

Is it possible to have my image come up by default with paging off, and to
add a paging file at runtime? Is there a way to do it without rebooting
(I'm thinking not).

Thanks,
Ann Adamson
 
Ann,

At runtime setup [HKLM\SYSTEM\CurrentControlSet\Control\Session
Manager\Memory Management],"PagingFiles" (REG_MULTI_SZ) reg value to speficy
the paging file (e.g., c:\pagefile.sys 2 4, where 2 and 4 are initial size
and maximum size of the pagefil.sys on c:\ in MB units).

To not reboot the system, you can try to call NT native API:
NTSYSAPI
NTSTATUS
NTAPI
NtCreatePagingFile (
IN PUNICODE_STRING PageFileName,
IN PLARGE_INTEGER InitialSize,
IN PLARGE_INTEGER MaximumSize,
IN ULONG Reserved
);

Set 0 for Reserved. InitialSize and MaximumSize are in bytes.

(Search Google for more info).

KM
 
Back
Top