home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / windev.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  9.5 KB  |  228 lines

  1. /*++
  2. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. PARTICULAR PURPOSE.
  6. Copyright (c) 1995, 1996, 1997  Microsoft Corporation
  7.  
  8. Module Name:  
  9.  
  10. windev.h
  11.  
  12. Abstract:  
  13.  
  14. Notes: 
  15.  
  16.  
  17. --*/
  18. #ifndef __WINDEV_H__
  19. #define __WINDEV_H__ 1
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. // @doc OSDEVICE
  26.  
  27. //      @func PVOID | ttt_Init | Device initialization routine
  28. //  @parm DWORD | dwInfo | info passed to RegisterDevice
  29. //  @rdesc      Returns a DWORD which will be passed to Open & Deinit or NULL if
  30. //                      unable to initialize the device.
  31. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  32. //                      lpszType in RegisterDevice
  33.  
  34. DWORD ttt_Init(DWORD dwInfo);
  35.  
  36. //      @func PVOID | ttt_Deinit | Device deinitialization routine
  37. //  @parm DWORD | dwData | value returned from ttt_Init call
  38. //  @rdesc      Returns TRUE for success, FALSE for failure.
  39. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  40. //                      lpszType in RegisterDevice
  41.  
  42. BOOL ttt_Deinit(DWORD dwData);
  43.  
  44. //      @func PVOID | ttt_Open | Device open routine
  45. //  @parm DWORD | dwData | value returned from ttt_Init call
  46. //  @parm DWORD | dwAccess | requested access (combination of GENERIC_READ and GENERIC_WRITE)
  47. //  @parm DWORD | dwShareMode | requested share mode (combination of FILE_SHARE_READ and FILE_SHARE_WRITE)
  48. //  @rdesc      Returns a DWORD which will be passed to Read, Write, etc or NULL if
  49. //                      unable to open device.
  50. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  51. //                      lpszType in RegisterDevice
  52.  
  53. DWORD ttt_Open(DWORD dwData, DWORD dwAccess, DWORD dwShareMode);
  54.  
  55. //      @func BOOL | ttt_Close | Device close routine
  56. //  @parm DWORD | dwOpenData | value returned from ttt_Open call
  57. //  @rdesc      Returns TRUE for success, FALSE for failure
  58. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  59. //                      lpszType in RegisterDevice
  60.  
  61. BOOL ttt_Close(DWORD dwOpenData);
  62.  
  63. //      @func DWORD | ttt_Read | Device read routine
  64. //  @parm DWORD | dwOpenData | value returned from ttt_Open call
  65. //  @parm LPVOID | pBuf | buffer to receive data
  66. //  @parm DWORD | len | maximum length to read
  67. //  @rdesc      Returns 0 for end of file, -1 for error, otherwise the number of
  68. //                      bytes read.  The length returned is guaranteed to be the length
  69. //                      requested unless end of file or an error condition occurs.
  70. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  71. //                      lpszType in RegisterDevice
  72.  
  73. DWORD ttt_Read(DWORD dwOpenData, LPVOID pBuf, DWORD len);
  74.  
  75. //      @func DWORD | ttt_Write | Device write routine
  76. //  @parm DWORD | dwOpenData | value returned from ttt_Open call
  77. //  @parm LPCVOID | pBuf | buffer containing data
  78. //  @parm DWORD | len | maximum length to write
  79. //  @rdesc      Returns -1 for error, otherwise the number of bytes written.  The
  80. //                      length returned is guaranteed to be the length requested unless an
  81. //                      error condition occurs.
  82. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  83. //                      lpszType in RegisterDevice
  84.  
  85. DWORD ttt_Write(DWORD dwOpenData, LPCVOID pBuf, DWORD len);
  86.  
  87. //      @func DWORD | ttt_Seek | Device seek routine
  88. //  @parm DWORD | dwOpenData | value returned from ttt_Open call
  89. //  @parm long | pos | position to seek to (relative to type)
  90. //  @parm DWORD | type | FILE_BEGIN, FILE_CURRENT, or FILE_END
  91. //  @rdesc      Returns current position relative to start of file, or -1 on error
  92. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  93. //                      lpszType in RegisterDevice
  94.  
  95. DWORD ttt_Seek(DWORD dwOpenData, long pos, DWORD type);
  96.  
  97. //      @func BOOL | ttt_IOControl | Device IO control routine
  98. //  @parm DWORD | dwOpenData | value returned from ttt_Open call
  99. //  @parm DWORD | dwCode | io control code to be performed
  100. //  @parm PBYTE | pBufIn | input data to the device
  101. //  @parm DWORD | dwLenIn | number of bytes being passed in
  102. //  @parm PBYTE | pBufOut | output data from the device
  103. //  @parm DWORD | dwLenOut |maximum number of bytes to receive from device
  104. //  @parm PDWORD | dwActualOut | actual number of bytes received from device
  105. //  @rdesc      Returns TRUE for success, FALSE for failure
  106. //      @comm   Routine exported by a device driver.  "ttt" is the string passed in as
  107. //                      lpszType in RegisterDevice
  108.  
  109. BOOL ttt_IOControl(DWORD dwOpenData, DWORD dwCode, PBYTE pBufIn, DWORD dwLenIn, PBYTE pBufOut, DWORD dwLenOut, PDWORD dwActualOut);
  110.  
  111. //      @func void | ttt_PowerDown | Device powerdown routine
  112. //  @parm DWORD | dwData | value returned from ttt_Init call
  113. //      @comm   Called to suspend device.  You cannot call any routines aside from
  114. //                      those in your dll in this call.
  115.  
  116. void ttt_PowerDown(DWORD dwData);
  117.  
  118. //      @func void | ttt_PowerUp | Device powerup routine
  119. //  @parm DWORD | dwData | value returned from ttt_Init call
  120. //      @comm   Called to restore device from suspend mode.  You cannot call any
  121. //                      routines aside from those in your dll in this call.
  122.  
  123. void ttt_PowerUp(DWORD dwData);
  124.  
  125. //
  126. // Macro definition for defining IOCTL and FSCTL function control codes.  Note
  127. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  128. // 2048-4095 are reserved for customers.
  129. //
  130.  
  131. #define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
  132.     ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  133. )
  134.  
  135. //
  136. // Define the method codes for how buffers are passed for I/O and FS controls
  137. //
  138.  
  139. #define METHOD_BUFFERED                 0
  140. #define METHOD_IN_DIRECT                1
  141. #define METHOD_OUT_DIRECT               2
  142. #define METHOD_NEITHER                  3
  143.  
  144. //
  145. // Define the access check value for any access
  146. //
  147. //
  148. // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
  149. // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
  150. // constants *MUST* always be in sync.
  151. //
  152.  
  153. #define FILE_ANY_ACCESS                 0
  154. #define FILE_READ_ACCESS          ( 0x0001 )    // file & pipe
  155. #define FILE_WRITE_ACCESS         ( 0x0002 )    // file & pipe
  156.  
  157.  
  158. // begin_ntddk begin_nthal begin_ntifs
  159. //
  160. // Define the various device type values.  Note that values used by Microsoft
  161. // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
  162. // by customers.
  163. //
  164.  
  165. #define DEVICE_TYPE ULONG
  166.  
  167. #define FILE_DEVICE_BEEP                0x00000001
  168. #define FILE_DEVICE_CD_ROM              0x00000002
  169. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM  0x00000003
  170. #define FILE_DEVICE_CONTROLLER          0x00000004
  171. #define FILE_DEVICE_DATALINK            0x00000005
  172. #define FILE_DEVICE_DFS                 0x00000006
  173. #define FILE_DEVICE_DISK                0x00000007
  174. #define FILE_DEVICE_DISK_FILE_SYSTEM    0x00000008
  175. #define FILE_DEVICE_FILE_SYSTEM         0x00000009
  176. #define FILE_DEVICE_INPORT_PORT         0x0000000a
  177. #define FILE_DEVICE_KEYBOARD            0x0000000b
  178. #define FILE_DEVICE_MAILSLOT            0x0000000c
  179. #define FILE_DEVICE_MIDI_IN             0x0000000d
  180. #define FILE_DEVICE_MIDI_OUT            0x0000000e
  181. #define FILE_DEVICE_MOUSE               0x0000000f
  182. #define FILE_DEVICE_MULTI_UNC_PROVIDER  0x00000010
  183. #define FILE_DEVICE_NAMED_PIPE          0x00000011
  184. #define FILE_DEVICE_NETWORK             0x00000012
  185. #define FILE_DEVICE_NETWORK_BROWSER     0x00000013
  186. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  187. #define FILE_DEVICE_NULL                0x00000015
  188. #define FILE_DEVICE_PARALLEL_PORT       0x00000016
  189. #define FILE_DEVICE_PHYSICAL_NETCARD    0x00000017
  190. #define FILE_DEVICE_PRINTER             0x00000018
  191. #define FILE_DEVICE_SCANNER             0x00000019
  192. #define FILE_DEVICE_SERIAL_MOUSE_PORT   0x0000001a
  193. #define FILE_DEVICE_SERIAL_PORT         0x0000001b
  194. #define FILE_DEVICE_SCREEN              0x0000001c
  195. #define FILE_DEVICE_SOUND               0x0000001d
  196. #define FILE_DEVICE_STREAMS             0x0000001e
  197. #define FILE_DEVICE_TAPE                0x0000001f
  198. #define FILE_DEVICE_TAPE_FILE_SYSTEM    0x00000020
  199. #define FILE_DEVICE_TRANSPORT           0x00000021
  200. #define FILE_DEVICE_UNKNOWN             0x00000022
  201. #define FILE_DEVICE_VIDEO               0x00000023
  202. #define FILE_DEVICE_VIRTUAL_DISK        0x00000024
  203. #define FILE_DEVICE_WAVE_IN             0x00000025
  204. #define FILE_DEVICE_WAVE_OUT            0x00000026
  205. #define FILE_DEVICE_8042_PORT           0x00000027
  206. #define FILE_DEVICE_NETWORK_REDIRECTOR  0x00000028
  207.  
  208.  
  209.  
  210. // EnumDevices enumerates the active devices in the system.
  211. // The return buffer is filled with a double-NULL terminated list of NULL
  212. // terminated strings of the device names, for example: COM1:\0COM2:\0PGR1:\0\0.
  213. DWORD EnumDevices(LPTSTR DevList, LPDWORD lpBuflen);
  214.  
  215. // GetDeviceKeys returns the registry paths for the device driver key and the
  216. // active device key for the specified device.
  217. DWORD GetDeviceKeys(LPCTSTR DevName, LPTSTR ActiveKey, LPDWORD lpActiveLen,
  218.                     LPTSTR DriverKey, LPDWORD lpDriverLen);
  219.  
  220. // IsAPIReady tells whether the specified API set has been registered
  221. BOOL IsAPIReady(DWORD hAPI);
  222.  
  223. #ifdef __cplusplus
  224. }
  225. #endif
  226.  
  227. #endif    // __WINDEV_H__
  228.