Allocates non-swappable memory pages.
#include "scnsm.h"
BOOL DeviceIoControl(
HANDLE hDevice,
// handle to SCNSM driver
DWORD dwControlCode,
// control code of operation to perform
LPVOID pInBuffer
// (Unused) pointer to input data buffer
DWORD cbInBuffer
// (Unused) size of input buffer
LPVOID pOutBuffer
// pointer to output data buffer
DWORD cbOutBuffer
// number of pages to allocate
LPDWORD pcbReturned
// (Unused) pointer to receive output byte count
LPOVERLAPPED pOverlapped
// (Unused)
);
include scnsm.inc
mov
ax, dwControlCode
mov
bx, cbOutBuffer
lea
cx, pOutBuffer
lea
dx, hOutBuffer
call
[hDevice]
Uses EAX, EBX, ECX, EDX, Flags.
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 for error codes defined below.
If the function succeeds, the EAX register is zero. If the function fails, the EAX register holds an error code defined below.
Windows 3.x does not support dynamic allocation fixed, contiguous memory pages as required by AllocPage. Win3.x allows such allocations only when the driver is loaded, at startup. Consequently, When SCNSM is loaded, a single, semaphore-locked page is allocated and used throughout that Windows session. If the page has already been allocated to a process, AllocPage fails with ERROR_LOCK_VIOLATION until the process holding the page frees it with FreePage.