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.

228 lines
3.7 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Class: Common
  4. //
  5. // Purpose: Contains Winnt routines and properties that are common to
  6. // all Winnt objects. Winnt objects get the routines and
  7. // properties through C++ inheritance.
  8. //
  9. //-------------------------------------------------------------------------
  10. #define MAX_DWORD 0xFFFFFFFF
  11. #define SCHEMA_NAME L"Schema"
  12. HRESULT
  13. MakeUncName(
  14. LPWSTR szSrcBuffer,
  15. LPWSTR szTargBuffer
  16. );
  17. HRESULT
  18. ValidateOutParameter(
  19. BSTR * retval
  20. );
  21. HRESULT
  22. BuildADsPath(
  23. LPWSTR Parent,
  24. LPWSTR Name,
  25. LPWSTR *pADsPath
  26. );
  27. HRESULT
  28. BuildSchemaPath(
  29. LPWSTR Parent,
  30. LPWSTR Name,
  31. LPWSTR Schema,
  32. LPWSTR *pSchemaPath
  33. );
  34. HRESULT
  35. BuildADsGuid(
  36. REFCLSID clsid,
  37. BSTR *pADsClass
  38. );
  39. //
  40. // (remote or local) machine's product type
  41. //
  42. typedef DWORD PRODUCTTYPE;
  43. #define PRODTYPE_INVALID 0
  44. #define PRODTYPE_WKSTA 1 // workstation
  45. #define PRODTYPE_STDALONESVR 2 // standalone server
  46. #define PRODTYPE_DC 3 // domain controller (primary or backup)
  47. HRESULT
  48. GetMachineProductType(
  49. IN LPTSTR pszServer,
  50. OUT PRODUCTTYPE *pdwProductType
  51. );
  52. //
  53. // Accessing Well-known object types
  54. //
  55. typedef struct _filters {
  56. WCHAR szObjectName[MAX_PATH];
  57. DWORD dwFilterId;
  58. } FILTERS, *PFILTERS;
  59. extern PFILTERS gpFilters;
  60. extern DWORD gdwMaxFilters;
  61. HRESULT
  62. GetObjectType(
  63. PFILTERS pFilters,
  64. DWORD dwMaxFilters,
  65. LPWSTR ClassName,
  66. PDWORD pdwObjectType
  67. );
  68. HRESULT
  69. BuildObjectInfo(
  70. LPWSTR ADsParent,
  71. LPWSTR Name,
  72. POBJECTINFO * ppObjectInfo
  73. );
  74. HRESULT
  75. BuildObjectInfo(
  76. LPWSTR ADsPath,
  77. POBJECTINFO * ppObjectInfo
  78. );
  79. HRESULT
  80. MakeWinNTDomainAndName(
  81. POBJECTINFO pObjectInfo,
  82. LPWSTR szDomName
  83. );
  84. HRESULT
  85. MakeWinNTAccountName(
  86. POBJECTINFO pObjectInfo,
  87. LPWSTR szDomName,
  88. BOOL fConnectToReg
  89. );
  90. VOID
  91. FreeObjectInfo(
  92. POBJECTINFO pObjectInfo,
  93. BOOL fStatic = FALSE
  94. );
  95. HRESULT
  96. CopyObjectInfo(
  97. POBJECTINFO pObjectInfo,
  98. POBJECTINFO *pTargObjectInfo
  99. );
  100. HRESULT
  101. ValidateObject(
  102. DWORD dwObjectType,
  103. POBJECTINFO pObjectInfo,
  104. CWinNTCredentials& Credentials
  105. );
  106. HRESULT
  107. ValidateProvider(
  108. POBJECTINFO pObjectInfo
  109. );
  110. HRESULT
  111. GetDomainFromPath(
  112. LPTSTR ADsPath,
  113. LPTSTR szDomainName
  114. );
  115. HRESULT
  116. GetServerFromPath(
  117. LPTSTR ADsPath,
  118. LPTSTR szDomainName
  119. );
  120. HRESULT
  121. GetPrinterNameFromInfo(
  122. LPTSTR szInfoName,
  123. LPTSTR szPrinterName
  124. );
  125. BOOL
  126. WinNTEnumPrinters(
  127. DWORD dwType,
  128. LPTSTR lpszName,
  129. DWORD dwLevel,
  130. LPBYTE *lplpbPrinters,
  131. LPDWORD lpdwReturned
  132. );
  133. BOOL
  134. WinNTGetPrinter(
  135. HANDLE hPrinter,
  136. DWORD dwLevel,
  137. LPBYTE *lplpbPrinters
  138. );
  139. DWORD
  140. TickCountDiff(
  141. DWORD dwTime1,
  142. DWORD dwTime2
  143. );
  144. HRESULT
  145. BuildComputerFromObjectInfo(POBJECTINFO pObjectInfo,
  146. LPTSTR pszADsPath
  147. );
  148. HRESULT
  149. DelimitedStringToVariant(
  150. LPTSTR pszString,
  151. VARIANT *pvar,
  152. TCHAR Delimiter
  153. );
  154. HRESULT
  155. FPNWSERVERADDRtoString(
  156. FPNWSERVERADDR WkstaAddress,
  157. LPWSTR * pszString
  158. );
  159. PKEYDATA
  160. CreateTokenList(
  161. LPWSTR pKeyData
  162. );
  163. DWORD
  164. DelimitedStrSize(
  165. LPWSTR pszString,
  166. WCHAR Delimiter
  167. );
  168. DWORD
  169. NulledStrSize(
  170. LPWSTR pszString
  171. );
  172. HRESULT
  173. GetSidIntoCache(
  174. LPTSTR lpszServerName,
  175. LPTSTR lpszHostName,
  176. CPropertyCache * pPropertyCache,
  177. BOOL fExplicit
  178. );