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.

192 lines
3.3 KiB

  1. #define FACILITY_NWRDR 0x11
  2. #define NWRDR_PASSWORD_HAS_EXPIRED 0x40110001
  3. typedef struct _NW_VERSION_INFO {
  4. BYTE szName[48];
  5. BYTE Version;
  6. BYTE SubVersion;
  7. WORD ConnsSupported;
  8. WORD connsInUse;
  9. WORD maxVolumes;
  10. BYTE OSRev;
  11. BYTE SFTLevel;
  12. BYTE TTSLevel;
  13. WORD PeakConns;
  14. BYTE AcctVer;
  15. BYTE VAPVer;
  16. BYTE QueueVer;
  17. BYTE PrintVer;
  18. BYTE VirtualConsoleVer;
  19. BYTE SecurityResLevel;
  20. BYTE InternetworkBVer;
  21. BYTE Reserved[60];
  22. } NW_VERSION_INFO, *PNW_VERSION_INFO;
  23. //
  24. // Size Of Things
  25. //
  26. #define OBJ_NAME_SIZE 48 // ScanObject name size
  27. #define VOL_NAME_SIZE 16 // Get Volume Name Size
  28. #define NW_USER_SIZE 50
  29. #define NW_GROUP_SIZE 50
  30. #define NW_PROP_SIZE 50
  31. #define NW_DATA_SIZE 128
  32. #define NW_PROP_SET 0x02
  33. //
  34. // Swap MACROS
  35. //
  36. #define wSWAP(x) (USHORT)(((((USHORT)x)<<8)&0xFF00) | ((((USHORT)x)>>8)&0x00FF))
  37. #define dwSWAP(x) (DWORD)( ((((DWORD)x)<<24)&0xFF000000) | ((((DWORD)x)<<8)&0x00FF0000) | ((((DWORD)x)>>8)&0x0000FF00) | ((((DWORD)x)>>24)&0x000000FF) )
  38. #define DW_SIZE 4 // used for placing RAW bytes
  39. #define W_SIZE 2
  40. //
  41. // NCP wrappers.
  42. //
  43. STDAPI
  44. NWApiGetBinderyHandle(
  45. NWCONN_HANDLE *phConnReturned,
  46. BSTR bstrBinderyName,
  47. CCredentials &Credentials
  48. );
  49. STDAPI
  50. NWApiReleaseBinderyHandle(
  51. NWCONN_HANDLE hConn
  52. );
  53. STDAPI
  54. NWApiCheckUserLoggedInToServer(
  55. BSTR bstrBinderyName,
  56. LPWSTR pszUserName
  57. );
  58. STDAPI
  59. NWApiObjectEnum(
  60. NWCONN_HANDLE hConn,
  61. NWOBJ_TYPE dwObjType,
  62. LPWSTR *lppszObjectName,
  63. DWORD *pdwResumeObjectID
  64. );
  65. STDAPI
  66. NWApiValidateObject(
  67. NWCONN_HANDLE hConn,
  68. NWOBJ_TYPE dwObjType,
  69. LPWSTR lpszObjectName,
  70. DWORD *pdwResumeObjectID
  71. );
  72. STDAPI
  73. NWApiGetAnyBinderyHandle(
  74. NWCONN_HANDLE *phConn
  75. );
  76. //
  77. // Error code conversion function.
  78. //
  79. STDAPI
  80. HRESULT_FROM_NWCCODE(
  81. NWCCODE usRet
  82. );
  83. STDAPI_(DWORD)
  84. NWApiGetAnyBinderyName(
  85. LPWSTR szBinderyName
  86. );
  87. //
  88. // Win32 wrappers.
  89. //
  90. STDAPI
  91. NWApiOpenPrinter(
  92. LPWSTR lpszUncPrinterName,
  93. HANDLE *phPrinter,
  94. DWORD dwAccess
  95. );
  96. STDAPI
  97. NWApiClosePrinter(
  98. HANDLE hPrinter
  99. );
  100. STDAPI
  101. NWApiEnumJobs(
  102. HANDLE hPrinter,
  103. DWORD dwFirstJob,
  104. DWORD dwNoJobs,
  105. DWORD dwLevel,
  106. LPBYTE *lplpbJobs,
  107. DWORD *pcbBuf,
  108. LPDWORD lpdwReturned
  109. );
  110. /*
  111. HRESULT
  112. NWApiGetPrinter(
  113. HANDLE hPrinter,
  114. DWORD dwLevel,
  115. LPBYTE *lplpbPrinters
  116. );
  117. */
  118. STDAPI
  119. NWApiSetPrinter(
  120. HANDLE hPrinter,
  121. DWORD dwLevel,
  122. LPBYTE lpbPrinters,
  123. DWORD dwAccess
  124. );
  125. STDAPI
  126. NWApiGetJob(
  127. HANDLE hPrinter,
  128. DWORD dwJobId,
  129. DWORD dwLevel,
  130. LPBYTE *lplpbJobs
  131. );
  132. STDAPI
  133. NWApiSetJob(
  134. HANDLE hPrinter,
  135. DWORD dwJobId,
  136. DWORD dwLevel,
  137. LPBYTE lpbJobs,
  138. DWORD dwCommand
  139. );
  140. STDAPI
  141. NWApiCreateProperty(
  142. NWCONN_HANDLE hConn,
  143. LPWSTR lpszObjectName,
  144. NWOBJ_TYPE wObjType,
  145. LPSTR lpszPropertyName,
  146. NWFLAGS ucObjectFlags
  147. );
  148. STDAPI
  149. NWApiWriteProperty(
  150. NWCONN_HANDLE hConn,
  151. BSTR bstrObjectName,
  152. NWOBJ_TYPE wObjType,
  153. LPSTR lpszPropertyName,
  154. LPBYTE SegmentData
  155. );
  156. STDAPI
  157. NWApiGetObjectName(
  158. NWCONN_HANDLE hConn,
  159. DWORD dwObjectID,
  160. LPWSTR *lppszObjectName
  161. );