Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. DbgInit.cxx
  5. Abstract:
  6. Initialization and utility functions for the debug library
  7. Author:
  8. Kamen Moutafov (kamenm) Dec 99 - Feb 2000
  9. Revision History:
  10. --*/
  11. #include <precomp.hxx>
  12. static DWORD gPageSize = 0;
  13. BOOL g_fDbgLibInitialized = FALSE;
  14. DWORD GetPageSize(void)
  15. {
  16. return gPageSize;
  17. }
  18. RPC_STATUS InitializeDbgLib(void)
  19. {
  20. SYSTEM_BASIC_INFORMATION BasicInfo;
  21. NTSTATUS Status;
  22. if (g_fDbgLibInitialized)
  23. return RPC_S_OK;
  24. Status = NtQuerySystemInformation(
  25. SystemBasicInformation,
  26. &BasicInfo,
  27. sizeof(BasicInfo),
  28. NULL
  29. );
  30. if ( !NT_SUCCESS(Status) )
  31. {
  32. DbgPrint("RPCDBGLIG: NtQuerySystemInformation failed: %x\n", Status);
  33. return RPC_S_INTERNAL_ERROR;
  34. }
  35. gPageSize = BasicInfo.PageSize;
  36. g_fDbgLibInitialized = TRUE;
  37. return RPC_S_OK;
  38. }