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.

140 lines
3.7 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 1999 - 1999
  5. //
  6. // File: logstor.h
  7. //
  8. // Contents: Public functions in logstor.cpp
  9. //
  10. // History: 15-Sep-00 philh created
  11. //--------------------------------------------------------------------------
  12. #ifndef __LOGSTOR_H__
  13. #define __LOGSTOR_H__
  14. //+-------------------------------------------------------------------------
  15. // Register wait for callback functions
  16. //--------------------------------------------------------------------------
  17. typedef VOID (NTAPI * ILS_WAITORTIMERCALLBACK) (PVOID, BOOLEAN );
  18. BOOL
  19. WINAPI
  20. ILS_RegisterWaitForSingleObject(
  21. PHANDLE hNewWaitObject,
  22. HANDLE hObject,
  23. ILS_WAITORTIMERCALLBACK Callback,
  24. PVOID Context,
  25. ULONG dwMilliseconds,
  26. ULONG dwFlags
  27. );
  28. BOOL
  29. WINAPI
  30. ILS_UnregisterWait(
  31. HANDLE WaitHandle
  32. );
  33. BOOL
  34. WINAPI
  35. ILS_ExitWait(
  36. HANDLE WaitHandle,
  37. HMODULE hLibModule
  38. );
  39. //+-------------------------------------------------------------------------
  40. // Registry support functions
  41. //--------------------------------------------------------------------------
  42. void
  43. ILS_EnableBackupRestorePrivileges();
  44. void
  45. ILS_CloseRegistryKey(
  46. IN HKEY hKey
  47. );
  48. BOOL
  49. ILS_ReadDWORDValueFromRegistry(
  50. IN HKEY hKey,
  51. IN LPCWSTR pwszValueName,
  52. IN DWORD *pdwValue
  53. );
  54. BOOL
  55. ILS_ReadBINARYValueFromRegistry(
  56. IN HKEY hKey,
  57. IN LPCWSTR pwszValueName,
  58. OUT BYTE **ppbValue,
  59. OUT DWORD *pcbValue
  60. );
  61. //+-------------------------------------------------------------------------
  62. // Get and allocate the REG_SZ value
  63. //--------------------------------------------------------------------------
  64. LPWSTR ILS_ReadSZValueFromRegistry(
  65. IN HKEY hKey,
  66. IN LPCWSTR pwszValueName
  67. );
  68. LPSTR ILS_ReadSZValueFromRegistry(
  69. IN HKEY hKey,
  70. IN LPCSTR pszValueName
  71. );
  72. //+-------------------------------------------------------------------------
  73. // Key Identifier registry and roaming file support functions
  74. //--------------------------------------------------------------------------
  75. BOOL
  76. ILS_ReadKeyIdElement(
  77. IN const CRYPT_HASH_BLOB *pKeyIdentifier,
  78. IN BOOL fLocalMachine,
  79. IN OPTIONAL LPCWSTR pwszComputerName,
  80. OUT BYTE **ppbElement,
  81. OUT DWORD *pcbElement
  82. );
  83. BOOL
  84. ILS_WriteKeyIdElement(
  85. IN const CRYPT_HASH_BLOB *pKeyIdentifier,
  86. IN BOOL fLocalMachine,
  87. IN OPTIONAL LPCWSTR pwszComputerName,
  88. IN const BYTE *pbElement,
  89. IN DWORD cbElement
  90. );
  91. BOOL
  92. ILS_DeleteKeyIdElement(
  93. IN const CRYPT_HASH_BLOB *pKeyIdentifier,
  94. IN BOOL fLocalMachine,
  95. IN OPTIONAL LPCWSTR pwszComputerName
  96. );
  97. typedef BOOL (*PFN_ILS_OPEN_KEYID_ELEMENT)(
  98. IN const CRYPT_HASH_BLOB *pKeyIdentifier,
  99. IN const BYTE *pbElement,
  100. IN DWORD cbElement,
  101. IN void *pvArg
  102. );
  103. BOOL
  104. ILS_OpenAllKeyIdElements(
  105. IN BOOL fLocalMachine,
  106. IN OPTIONAL LPCWSTR pwszComputerName,
  107. IN void *pvArg,
  108. IN PFN_ILS_OPEN_KEYID_ELEMENT pfnOpenKeyId
  109. );
  110. //+-------------------------------------------------------------------------
  111. // Misc alloc and copy functions
  112. //--------------------------------------------------------------------------
  113. LPWSTR ILS_AllocAndCopyString(
  114. IN LPCWSTR pwszSrc,
  115. IN LONG cchSrc = -1
  116. );
  117. //+-------------------------------------------------------------------------
  118. // Converts the bytes into UNICODE ASCII HEX
  119. //
  120. // Needs (cb * 2 + 1) * sizeof(WCHAR) bytes of space in wsz
  121. //--------------------------------------------------------------------------
  122. void ILS_BytesToWStr(DWORD cb, void* pv, LPWSTR wsz);
  123. #endif // __LOGSTOR_H__