- Cache system static information, such as PAGE_SIZE at kernel32 startup, so we can reference it in our code without always quertying the system for it.

svn path=/trunk/; revision=22521
This commit is contained in:
Alex Ionescu 2006-06-22 23:44:17 +00:00
parent 8727a1f7ff
commit 2c010d69e8

View file

@ -56,6 +56,8 @@ DuplicateConsoleHandle(HANDLE hConsole,
#define WIN_OBJ_DIR L"\\Windows"
#define SESSION_DIR L"\\Sessions"
SYSTEM_BASIC_INFORMATION BaseCachedSysInfo;
/* FUNCTIONS *****************************************************************/
NTSTATUS
@ -382,6 +384,17 @@ DllMain(HANDLE hDll,
return FALSE;
}
/* Cache static system information */
Status = ZwQuerySystemInformation(SystemBasicInformation,
&BaseCachedSysInfo,
sizeof(BaseCachedSysInfo),
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failure to get system information\n");
return FALSE;
}
/* Insert more dll attach stuff here! */
DllInitialized = TRUE;
DPRINT("Initialization complete\n");