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.

281 lines
5.3 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991-1993 Microsoft Corporation
  3. Module Name:
  4. lmchdev.h
  5. Abstract:
  6. This module defines the API function prototypes and data structures
  7. for the following groups of NT API functions:
  8. NetCharDev
  9. NetCharDevQ
  10. NetHandle
  11. Author:
  12. Dan Lafferty (danl) 11-Mar-1991
  13. [Environment:]
  14. User Mode - Win32
  15. [Notes:]
  16. You must include NETCONS.H before this file, since this file depends
  17. on values defined in NETCONS.H.
  18. Revision History:
  19. 11-Mar-1991 Danl
  20. Created from LM2.0 header files and NT-LAN API Spec.
  21. 14-Apr-1991 w-shanku
  22. Changed ParmNum constants to be more consistent with OS/2 parmnums.
  23. --*/
  24. #ifndef _LMCHDEV_
  25. #define _LMCHDEV_
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. //
  30. // CharDev Class
  31. //
  32. //
  33. // Function Prototypes - CharDev
  34. //
  35. NET_API_STATUS NET_API_FUNCTION
  36. NetCharDevEnum (
  37. IN LPTSTR servername,
  38. IN DWORD level,
  39. OUT LPBYTE *bufptr,
  40. IN DWORD prefmaxlen,
  41. OUT LPDWORD entriesread,
  42. OUT LPDWORD totalentries,
  43. IN OUT LPDWORD resume_handle
  44. );
  45. NET_API_STATUS NET_API_FUNCTION
  46. NetCharDevGetInfo (
  47. IN LPTSTR servername,
  48. IN LPTSTR devname,
  49. IN DWORD level,
  50. OUT LPBYTE *bufptr
  51. );
  52. NET_API_STATUS NET_API_FUNCTION
  53. NetCharDevControl (
  54. IN LPTSTR servername,
  55. IN LPTSTR devname,
  56. IN DWORD opcode
  57. );
  58. //
  59. // Data Structures - CharDev
  60. //
  61. typedef struct _CHARDEV_INFO_0 {
  62. LPTSTR ch0_dev;
  63. } CHARDEV_INFO_0, *PCHARDEV_INFO_0, *LPCHARDEV_INFO_0;
  64. typedef struct _CHARDEV_INFO_1 {
  65. LPTSTR ch1_dev;
  66. DWORD ch1_status;
  67. LPTSTR ch1_username;
  68. DWORD ch1_time;
  69. } CHARDEV_INFO_1, *PCHARDEV_INFO_1, *LPCHARDEV_INFO_1;
  70. //
  71. // CharDevQ Class
  72. //
  73. //
  74. // Function Prototypes - CharDevQ
  75. //
  76. NET_API_STATUS NET_API_FUNCTION
  77. NetCharDevQEnum (
  78. IN LPTSTR servername,
  79. IN LPTSTR username,
  80. IN DWORD level,
  81. OUT LPBYTE *bufptr,
  82. IN DWORD prefmaxlen,
  83. OUT LPDWORD entriesread,
  84. OUT LPDWORD totalentries,
  85. IN OUT LPDWORD resume_handle
  86. );
  87. NET_API_STATUS NET_API_FUNCTION
  88. NetCharDevQGetInfo (
  89. IN LPTSTR servername,
  90. IN LPTSTR queuename,
  91. IN LPTSTR username,
  92. IN DWORD level,
  93. OUT LPBYTE *bufptr
  94. );
  95. NET_API_STATUS NET_API_FUNCTION
  96. NetCharDevQSetInfo (
  97. IN LPTSTR servername,
  98. IN LPTSTR queuename,
  99. IN DWORD level,
  100. IN LPBYTE buf,
  101. OUT LPDWORD parm_err
  102. );
  103. NET_API_STATUS NET_API_FUNCTION
  104. NetCharDevQPurge (
  105. IN LPTSTR servername,
  106. IN LPTSTR queuename
  107. );
  108. NET_API_STATUS NET_API_FUNCTION
  109. NetCharDevQPurgeSelf (
  110. IN LPTSTR servername,
  111. IN LPTSTR queuename,
  112. IN LPTSTR computername
  113. );
  114. //
  115. // Data Structures - CharDevQ
  116. //
  117. typedef struct _CHARDEVQ_INFO_0 {
  118. LPTSTR cq0_dev;
  119. } CHARDEVQ_INFO_0, *PCHARDEVQ_INFO_0, *LPCHARDEVQ_INFO_0;
  120. typedef struct _CHARDEVQ_INFO_1 {
  121. LPTSTR cq1_dev;
  122. DWORD cq1_priority;
  123. LPTSTR cq1_devs;
  124. DWORD cq1_numusers;
  125. DWORD cq1_numahead;
  126. } CHARDEVQ_INFO_1, *PCHARDEVQ_INFO_1, *LPCHARDEVQ_INFO_1;
  127. typedef struct _CHARDEVQ_INFO_1002 {
  128. DWORD cq1002_priority;
  129. } CHARDEVQ_INFO_1002, *PCHARDEVQ_INFO_1002, *LPCHARDEVQ_INFO_1002;
  130. typedef struct _CHARDEVQ_INFO_1003 {
  131. LPTSTR cq1003_devs;
  132. } CHARDEVQ_INFO_1003, *PCHARDEVQ_INFO_1003, *LPCHARDEVQ_INFO_1003;
  133. //
  134. // Special Values and Constants
  135. //
  136. //
  137. // Bits for chardev_info_1 field ch1_status.
  138. //
  139. #define CHARDEV_STAT_OPENED 0x02
  140. #define CHARDEV_STAT_ERROR 0x04
  141. //
  142. // Opcodes for NetCharDevControl
  143. //
  144. #define CHARDEV_CLOSE 0
  145. //
  146. // Values for parm_err parameter.
  147. //
  148. #define CHARDEVQ_DEV_PARMNUM 1
  149. #define CHARDEVQ_PRIORITY_PARMNUM 2
  150. #define CHARDEVQ_DEVS_PARMNUM 3
  151. #define CHARDEVQ_NUMUSERS_PARMNUM 4
  152. #define CHARDEVQ_NUMAHEAD_PARMNUM 5
  153. //
  154. // Single-field infolevels for NetCharDevQSetInfo.
  155. //
  156. #define CHARDEVQ_PRIORITY_INFOLEVEL \
  157. (PARMNUM_BASE_INFOLEVEL + CHARDEVQ_PRIORITY_PARMNUM)
  158. #define CHARDEVQ_DEVS_INFOLEVEL \
  159. (PARMNUM_BASE_INFOLEVEL + CHARDEVQ_DEVS_PARMNUM)
  160. //
  161. // Minimum, maximum, and recommended default for priority.
  162. //
  163. #define CHARDEVQ_MAX_PRIORITY 1
  164. #define CHARDEVQ_MIN_PRIORITY 9
  165. #define CHARDEVQ_DEF_PRIORITY 5
  166. //
  167. // Value indicating no requests in the queue.
  168. //
  169. #define CHARDEVQ_NO_REQUESTS -1
  170. #endif // _LMCHDEV_
  171. //
  172. // Handle Class
  173. //
  174. #ifndef _LMHANDLE_
  175. #define _LMHANDLE_
  176. //
  177. // Function Prototypes
  178. //
  179. NET_API_STATUS NET_API_FUNCTION
  180. NetHandleGetInfo (
  181. IN HANDLE handle,
  182. IN DWORD level,
  183. OUT LPBYTE *bufptr
  184. );
  185. NET_API_STATUS NET_API_FUNCTION
  186. NetHandleSetInfo (
  187. IN HANDLE handle,
  188. IN DWORD level,
  189. IN LPBYTE buf,
  190. IN DWORD parmnum,
  191. OUT LPDWORD parmerr
  192. );
  193. //
  194. // Data Structures
  195. //
  196. typedef struct _HANDLE_INFO_1 {
  197. DWORD hdli1_chartime;
  198. DWORD hdli1_charcount;
  199. }HANDLE_INFO_1, *PHANDLE_INFO_1, *LPHANDLE_INFO_1;
  200. //
  201. // Special Values and Constants
  202. //
  203. //
  204. // Handle Get Info Levels
  205. //
  206. #define HANDLE_INFO_LEVEL_1 1
  207. //
  208. // Handle Set Info parm numbers
  209. //
  210. #define HANDLE_CHARTIME_PARMNUM 1
  211. #define HANDLE_CHARCOUNT_PARMNUM 2
  212. #ifdef __cplusplus
  213. }
  214. #endif
  215. #endif // _LMHANDLE_