Source code of Windows XP (NT5)
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.

293 lines
4.7 KiB

  1. //
  2. // NCP wrappers.
  3. //
  4. STDAPI
  5. NWApiGetProperty(
  6. BSTR bstrObjectName,
  7. char *PropertyName,
  8. NWOBJ_TYPE dwOT_ID,
  9. NWCONN_HANDLE hConn,
  10. LPP_RPLY_SGMT_LST lppReplySegment,
  11. LPDWORD pdwNumSegment
  12. );
  13. STDAPI
  14. NWApiGetFileServerVersionInfo(
  15. NWCONN_HANDLE hConn,
  16. NW_VERSION_INFO *pVersionInfo
  17. );
  18. STDAPI
  19. NWApiIsObjectInSet(
  20. NWCONN_HANDLE hConn,
  21. LPWSTR lpszObjectName,
  22. NWOBJ_TYPE wObjType,
  23. LPSTR lpszPropertyName,
  24. LPSTR lpszMemberName,
  25. NWOBJ_TYPE wMemberType
  26. );
  27. STDAPI
  28. NWApiGetObjectID(
  29. NWCONN_HANDLE hConn,
  30. LPWSTR lpszObjectName,
  31. NWOBJ_TYPE wObjType,
  32. NWOBJ_ID *pObjectID
  33. );
  34. STDAPI
  35. NWApiGroupGetMembers(
  36. NWCONN_HANDLE hConn,
  37. LPWSTR szGroupName,
  38. LPBYTE *lppBuffer
  39. );
  40. STDAPI
  41. NWApiAddGroupMember(
  42. NWCONN_HANDLE hConn,
  43. LPWSTR pszGroupName,
  44. LPWSTR pszMemberName
  45. );
  46. STDAPI
  47. NWApiRemoveGroupMember(
  48. NWCONN_HANDLE hConn,
  49. LPWSTR pszGroupName,
  50. LPWSTR pszMemberName
  51. );
  52. STDAPI
  53. NWApiGetLOGIN_CONTROL(
  54. NWCONN_HANDLE hConn,
  55. LPWSTR lpszUserName,
  56. LPLC_STRUCTURE lpLoginCtrlStruct
  57. );
  58. STDAPI
  59. NWApiSetDefaultAcctExpDate(
  60. DOUBLE * pdTime,
  61. SYSTEMTIME SysTime
  62. );
  63. STDAPI
  64. NWApiUserAsSupervisor(
  65. NWCONN_HANDLE hConn,
  66. LPWSTR lpszUserName,
  67. BOOL fSupervisor
  68. );
  69. STDAPI
  70. NWApiGetVolumeNumber(
  71. NWCONN_HANDLE hConn,
  72. LPWSTR lpszVolumeName,
  73. NWVOL_NUM *pVolumeNumber
  74. );
  75. STDAPI
  76. NWApiGetVolumeName(
  77. NWCONN_HANDLE hConn,
  78. NWVOL_NUM bVolNum,
  79. LPWSTR *lppszVolName
  80. );
  81. //
  82. // Win32 wrappers.
  83. //
  84. STDAPI
  85. NWApiGetPrinter(
  86. HANDLE hPrinter,
  87. DWORD dwLevel,
  88. LPBYTE *lplpbPrinters
  89. );
  90. STDAPI
  91. NWApiUncFromADsPath(
  92. LPWSTR lpszADsPath,
  93. LPWSTR lpszUncName
  94. );
  95. STDAPI
  96. NWApiMakeUserInfo(
  97. LPWSTR lpszBinderyName,
  98. LPWSTR lpszUserName,
  99. LPWSTR lpszPassword,
  100. CCredentials &Credentials,
  101. PNW_USER_INFO pNwUserInfo
  102. );
  103. STDAPI
  104. NWApiFreeUserInfo(
  105. PNW_USER_INFO pNwUserInfo
  106. );
  107. STDAPI
  108. NWApiCreateUser(
  109. PNW_USER_INFO pNwUserInfo
  110. );
  111. STDAPI
  112. NWApiDeleteUser(
  113. POBJECTINFO pObjectInfo,
  114. CCredentials &Credentials
  115. );
  116. STDAPI
  117. NWApiCreateBinderyObject(
  118. NWCONN_HANDLE hConn,
  119. LPWSTR lpszObjectName,
  120. NWOBJ_TYPE wObjType,
  121. NWFLAGS ucObjectFlags,
  122. NWFLAGS usObjSecurity
  123. );
  124. STDAPI
  125. NWApiDeleteBinderyObject(
  126. NWCONN_HANDLE hConn,
  127. LPWSTR lpszObjectName,
  128. NWOBJ_TYPE wObjType
  129. );
  130. HRESULT
  131. NWApiRenameObject(
  132. POBJECTINFO pObjectInfoSource,
  133. POBJECTINFO pObjectInfoTarget,
  134. NWOBJ_TYPE wObjType,
  135. CCredentials &Credentials
  136. );
  137. STDAPI
  138. NWApiSetUserPassword(
  139. PNW_USER_INFO pNwUserInfo,
  140. DWORD *pdwUserObjID,
  141. LPWSTR pszOldPassword
  142. );
  143. STDAPI
  144. NWApiCreateMailDirectory(
  145. PNW_USER_INFO pNwUserInfo,
  146. NWOBJ_ID UserObjID
  147. );
  148. STDAPI
  149. NWApiSetLoginCtrlAndAcctBalance(
  150. PNW_USER_INFO pNwUserInfo
  151. );
  152. STDAPI
  153. NWApiCreateGroup(
  154. POBJECTINFO pObjectInfo,
  155. CCredentials &Credentials
  156. );
  157. STDAPI
  158. NWApiDeleteGroup(
  159. POBJECTINFO pObjectInfo,
  160. CCredentials &Credentials
  161. );
  162. STDAPI
  163. NWApiCreatePrinter(
  164. POBJECTINFO pObjectInfo,
  165. CCredentials &Credentials
  166. );
  167. STDAPI
  168. NWApiDeletePrinter(
  169. POBJECTINFO pObjectInfo,
  170. CCredentials &Credentials
  171. );
  172. STDAPI
  173. NWApiCreatePrintQueue(
  174. NWCONN_HANDLE hConn,
  175. LPWSTR lpszQueueName
  176. );
  177. STDAPI
  178. NWApiDestroyPrintQueue(
  179. NWCONN_HANDLE hConn,
  180. LPWSTR lpszQueueName
  181. );
  182. //
  183. // Conversion functions.
  184. //
  185. DWORD
  186. NWApiMapNtStatusToDosError(
  187. IN NTSTATUS NtStatus
  188. );
  189. STDAPI
  190. NWApiConvertToAddressFormat(
  191. LP_RPLY_SGMT_LST lpReplySegment,
  192. LPWSTR *lppszAddresses
  193. );
  194. HRESULT
  195. NWApiMakeSYSTEMTIME(
  196. LPSYSTEMTIME pTime,
  197. WORD wDay, // Day = 1..31
  198. WORD wMonth, // Month = 1..12
  199. WORD wYear, // Year = (19XX or 20XX) - 1980, ie. 2019 -> 39
  200. WORD wSecond, // Second = 0..30, Second divided by 2
  201. WORD wMinute, // Minute = 0..59
  202. WORD wHour // Hour = 0..23
  203. );
  204. STDAPI
  205. NWApiMakeVariantTime(
  206. DOUBLE * pdTime,
  207. WORD wDay, // Day = 1..31
  208. WORD wMonth, // Month = 1..12
  209. WORD wYear, // Year = 19XX - 1980, e.g. 1996 is 16
  210. WORD wSecond, // Second = 0..30, Second divided by 2
  211. WORD wMinute, // Minute = 0..59
  212. WORD wHour // Hour = 0..23
  213. );
  214. STDAPI
  215. NWApiBreakVariantTime(
  216. DOUBLE daDate,
  217. PWORD pwDay,
  218. PWORD pwMonth,
  219. PWORD pwYear
  220. );
  221. WORD
  222. NWApiReverseWORD(
  223. WORD wWORD
  224. );
  225. STDAPI
  226. NWApiUserGetGroups(
  227. NWCONN_HANDLE hConn,
  228. LPWSTR szUserName,
  229. LPBYTE *lppBuffer
  230. );
  231. //
  232. // Misc functions to login to a NW server.
  233. //
  234. STDAPI
  235. NWApiLoginToServer(
  236. LPWSTR pszServerName,
  237. LPWSTR pszUserName,
  238. LPWSTR pszPassword
  239. );
  240. STDAPI
  241. NWApiLogoffServer(
  242. LPWSTR pszServerName
  243. );