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.

164 lines
2.9 KiB

  1. /*
  2. File uitls.h
  3. A set of utilities useful for upgrading mpr v1 to NT 5.0.
  4. Paul Mayfield, 9/11/97
  5. */
  6. #ifndef _rtrupg_utils_h
  7. #define _rtrupg_utils_h
  8. //
  9. // Definitions for a DWORD table (dwt)
  10. //
  11. typedef struct _tag_dwValueNode
  12. {
  13. PWCHAR Name;
  14. DWORD Value;
  15. } dwValueNode;
  16. typedef struct _tag_DWordTable
  17. {
  18. DWORD dwCount;
  19. DWORD dwSize;
  20. dwValueNode * pValues;
  21. } dwt, *pdwt;
  22. //
  23. // Typedef for callback functions in interface enumeration.
  24. // Return TRUE to continue the enumeration, FALSE to stop it.
  25. //
  26. typedef
  27. BOOL
  28. (*IfEnumFuncPtr)(
  29. IN HANDLE hConfig, // MprConfig handle
  30. IN MPR_INTERFACE_0 * pIf, // Interface reference
  31. IN HANDLE hUserData); // User defined
  32. //
  33. // Typedef for callback functions for enumerating registry sub keys.
  34. // Return NO_ERROR to continue, error code to stop.
  35. //
  36. typedef
  37. DWORD
  38. (*RegKeyEnumFuncPtr)(
  39. IN PWCHAR pszName, // sub key name
  40. IN HKEY hKey, // sub key
  41. IN HANDLE hData);
  42. //
  43. // Functions that manipulate dword tables
  44. //
  45. DWORD
  46. dwtInitialize(
  47. IN dwt *This,
  48. IN DWORD dwCount,
  49. IN DWORD dwMaxSize);
  50. DWORD
  51. dwtCleanup(
  52. IN dwt *This);
  53. DWORD
  54. dwtPrint(IN dwt *This);
  55. DWORD
  56. dwtGetValue(
  57. IN dwt *This,
  58. IN PWCHAR ValName,
  59. OUT LPDWORD pValue);
  60. DWORD
  61. dwtLoadRegistyTable(
  62. IN dwt *This,
  63. IN HKEY hkParams);
  64. //
  65. // Enumerates interfaces from the registry
  66. //
  67. DWORD
  68. UtlEnumerateInterfaces (
  69. IN IfEnumFuncPtr pCallback,
  70. IN HANDLE hUserData);
  71. DWORD
  72. UtlEnumRegistrySubKeys(
  73. IN HKEY hkRoot,
  74. IN PWCHAR pszPath,
  75. IN RegKeyEnumFuncPtr pCallback,
  76. IN HANDLE hData);
  77. //
  78. // If the given info blob exists in the given toc header
  79. // reset it with the given information, otherwise add
  80. // it as an entry in the TOC.
  81. //
  82. DWORD
  83. UtlUpdateInfoBlock (
  84. IN BOOL bOverwrite,
  85. IN LPVOID pHeader,
  86. IN DWORD dwEntryId,
  87. IN DWORD dwSize,
  88. IN DWORD dwCount,
  89. IN LPBYTE pEntry,
  90. OUT LPVOID* ppNewHeader,
  91. OUT LPDWORD lpdwNewSize);
  92. //
  93. // Other handy definitions
  94. //
  95. #if DBG
  96. #define PrintMessage OutputDebugStringW
  97. #else
  98. #define PrintMessage
  99. #endif
  100. // Common allocation routine
  101. PVOID
  102. UtlAlloc (
  103. IN DWORD dwSize);
  104. // Common deallocation routine
  105. VOID
  106. UtlFree (
  107. PVOID pvBuffer);
  108. PWCHAR
  109. UtlDupString(
  110. IN PWCHAR pszString);
  111. // Error printing
  112. void
  113. UtlPrintErr(
  114. DWORD err);
  115. // Helper functions
  116. DWORD
  117. UtlAccessRouterKey(
  118. HKEY* hkeyRouter);
  119. DWORD
  120. UtlSetupBackupPrivelege(
  121. BOOL bEnable);
  122. DWORD
  123. UtlSetupRestorePrivilege(
  124. BOOL bEnable);
  125. DWORD
  126. UtlLoadSavedSettings(
  127. IN HKEY hkRoot,
  128. IN PWCHAR pszTempKey,
  129. IN PWCHAR pszFile,
  130. OUT PHKEY phTemp);
  131. DWORD
  132. UtlDeleteRegistryTree(
  133. IN HKEY hkRoot);
  134. DWORD
  135. UtlMarkRouterConfigured();
  136. #endif