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.

260 lines
6.5 KiB

  1. #define MAXCOMPONENTS 10
  2. #define TOKEN_IDENTIFIER 1
  3. #define TOKEN_COMMA 2
  4. //
  5. // This no longer exists
  6. //#define TOKEN_BSLASH 3
  7. //
  8. #define TOKEN_END 4
  9. #define TOKEN_DOMAIN 5
  10. #define TOKEN_USER 6
  11. #define TOKEN_GROUP 7
  12. #define TOKEN_PRINTER 8
  13. #define TOKEN_COMPUTER 9
  14. #define TOKEN_SERVICE 10
  15. #define TOKEN_ATSIGN 11
  16. #define TOKEN_EXCLAMATION 12
  17. #define TOKEN_COLON 13
  18. #define TOKEN_FSLASH 14
  19. #define TOKEN_PROVIDER 15
  20. #define TOKEN_SCHEMA 16
  21. #define TOKEN_CLASS 17
  22. #define TOKEN_PROPERTY 18
  23. #define TOKEN_SYNTAX 19
  24. #define TOKEN_FILESHARE 20
  25. #define TOKEN_FILESERVICE 21
  26. #define TOKEN_NAMESPACE 22
  27. #define TOKEN_LOCALGROUP 23
  28. #define TOKEN_GLOBALGROUP 24
  29. #define TOKEN_WORKGROUP 25
  30. typedef struct _objectinfo {
  31. LPWSTR ProviderName;
  32. DWORD ObjectType;
  33. DWORD NumComponents;
  34. LPWSTR ComponentArray[MAXCOMPONENTS];
  35. LPWSTR DisplayComponentArray[MAXCOMPONENTS];
  36. } OBJECTINFO, *POBJECTINFO;
  37. HRESULT
  38. GetObject(LPWSTR szBuffer, LPVOID * ppObject, CWinNTCredentials& Credentials);
  39. HRESULT
  40. GetNamespaceObject(POBJECTINFO pObjectInfo, LPVOID * ppObject);
  41. HRESULT
  42. GetDomainObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  43. HRESULT
  44. GetWorkGroupObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  45. HRESULT
  46. GetUserObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  47. HRESULT
  48. GetComputerObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  49. HRESULT
  50. GetServiceObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  51. HRESULT
  52. GetPrinterObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  53. HRESULT
  54. GetFileServiceObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  55. HRESULT
  56. GetFileShareObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  57. HRESULT
  58. GetGroupObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  59. HRESULT
  60. GetLocalGroupObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  61. HRESULT
  62. GetGlobalGroupObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  63. HRESULT
  64. GetSchemaObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  65. HRESULT
  66. GetClassObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  67. HRESULT
  68. GetSyntaxObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  69. HRESULT
  70. GetPropertyObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  71. HRESULT
  72. HeuristicGetObject(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  73. // Additional Heuristic function to get the object on NOWKSTA services
  74. HRESULT
  75. HeuristicGetObjectNoWksta(POBJECTINFO pObjectInfo, LPVOID * ppObject, CWinNTCredentials& Credentials);
  76. HRESULT
  77. AddComponent(POBJECTINFO pObjectInfo, LPWSTR szToken, LPWSTR szDisplayToken);
  78. HRESULT
  79. AddProviderName(POBJECTINFO pObjectInfo, LPWSTR szToken);
  80. HRESULT
  81. SetType(POBJECTINFO pObjectInfo, DWORD dwToken);
  82. HRESULT
  83. ValidateNamespaceObject(
  84. POBJECTINFO pObjectInfo
  85. );
  86. HRESULT
  87. ValidateComputerObject(
  88. POBJECTINFO pObjectInfo,
  89. CWinNTCredentials& Credentials
  90. );
  91. HRESULT
  92. ValidateUserObject(
  93. POBJECTINFO pObjectInfo,
  94. PDWORD pdwParentId,
  95. CWinNTCredentials& Credentials
  96. );
  97. HRESULT
  98. ValidateGroupObject(
  99. POBJECTINFO pObjectInfo,
  100. PULONG puGroupType,
  101. PDWORD pdwParentId,
  102. CWinNTCredentials& Credentials
  103. );
  104. HRESULT
  105. BuildADsPath(POBJECTINFO pObjectInfo, LPWSTR szBuffer);
  106. HRESULT
  107. BuildParent(POBJECTINFO pObjectInfo, LPWSTR szBuffer);
  108. HRESULT
  109. BuildGrandParent(POBJECTINFO pObjectInfo, LPWSTR szBuffer);
  110. HRESULT
  111. ValidateComputerParent(
  112. LPWSTR szDomainName,
  113. LPWSTR szComputerName,
  114. CWinNTCredentials& Credentials
  115. );
  116. // Overloaded function called when SAM Name is required
  117. HRESULT
  118. ValidateComputerParent(
  119. LPWSTR szDomainName,
  120. LPWSTR szComputerName,
  121. LPWSTR szSAMName,
  122. CWinNTCredentials& Credentials
  123. );
  124. HRESULT
  125. ValidatePrinterObject(
  126. POBJECTINFO pObjectInfo,
  127. CWinNTCredentials& CCredentials
  128. );
  129. HRESULT
  130. ValidatePrintDeviceObject(
  131. POBJECTINFO pObjectInfo,
  132. CWinNTCredentials& CCredentials
  133. );
  134. HRESULT
  135. ValidateServiceObject(
  136. POBJECTINFO pObjectInfo,
  137. CWinNTCredentials& CCredentials
  138. );
  139. HRESULT
  140. ValidateFileServiceObject(
  141. POBJECTINFO pObjectInfo,
  142. CWinNTCredentials& CCredentials
  143. );
  144. HRESULT
  145. ValidateFileShareObject(
  146. POBJECTINFO pObjectInfo,
  147. CWinNTCredentials& CCredentials
  148. );
  149. HRESULT GetPrinterFromPath(
  150. LPTSTR *pszPrinter,
  151. LPWSTR szPathName
  152. );
  153. HRESULT
  154. ValidateGlobalGroupObject(
  155. LPWSTR szServerName,
  156. LPWSTR *pszGroupName,
  157. CWinNTCredentials& Credentials
  158. );
  159. HRESULT
  160. ValidateLocalGroupObject(
  161. LPWSTR szServerName,
  162. LPWSTR *pszGroupName,
  163. CWinNTCredentials& Credentials
  164. );
  165. HRESULT
  166. GetComputerParent(
  167. LPTSTR pszComputerName,
  168. LPTSTR pszComputerParentName,
  169. CWinNTCredentials& Credentials
  170. );
  171. HRESULT
  172. ConstructFullObjectInfo(
  173. POBJECTINFO pObjectInfo,
  174. POBJECTINFO *ppFullObjectInfo,
  175. CWinNTCredentials& Credentials
  176. );
  177. HRESULT
  178. GetGroupObjectInComputer(
  179. LPWSTR pszHostServerName, // pdc name
  180. POBJECTINFO pObjectInfo,
  181. CWinNTCredentials& Credentials,
  182. LPVOID * ppObject);
  183. HRESULT
  184. GetUserObjectInComputer(
  185. LPWSTR pszHostServerName, // pdc name
  186. POBJECTINFO pObjectInfo,
  187. CWinNTCredentials& Credentials,
  188. LPVOID * ppObject
  189. );
  190. HRESULT
  191. GetUserObjectInDomain(
  192. LPWSTR pszHostServerName,
  193. POBJECTINFO pObjectInfo,
  194. CWinNTCredentials& Credentials,
  195. LPVOID * ppObject
  196. );
  197. HRESULT
  198. GetUserObjectInComputer(
  199. LPWSTR pszHostServerName, // pdc name
  200. POBJECTINFO pObjectInfo,
  201. CWinNTCredentials& Credentials,
  202. LPVOID * ppObject
  203. );