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.

517 lines
14 KiB

  1. //==========================================================================;
  2. //
  3. // idrv.h
  4. //
  5. // Description:
  6. // This header file defines common information needed for compiling
  7. // the installable driver.
  8. //
  9. // History:
  10. // 11/ 8/92 cjp [curtisp]
  11. //
  12. //==========================================================================;
  13. #ifndef _INC_IDRV
  14. #define _INC_IDRV // #defined if file has been included
  15. #ifndef RC_INVOKED
  16. #pragma pack(1) // assume byte packing throughout
  17. #endif
  18. #ifndef EXTERN_C
  19. #ifdef __cplusplus
  20. #define EXTERN_C extern "C"
  21. #else
  22. #define EXTERN_C extern
  23. #endif
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" // assume C declarations for C++
  27. {
  28. #endif
  29. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  30. //
  31. // Win 32
  32. //
  33. //
  34. //
  35. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  36. #ifdef WIN32
  37. #ifndef FNLOCAL
  38. #define FNLOCAL
  39. #define FNCLOCAL
  40. #define FNGLOBAL
  41. #define FNCGLOBAL
  42. #define FNWCALLBACK CALLBACK
  43. #define FNEXPORT CALLBACK
  44. #endif
  45. //
  46. //
  47. //
  48. #define Edit_GetSelEx(hwndCtl, pnS, pnE) \
  49. ((DWORD)SendMessage((hwndCtl), EM_GETSEL, (WPARAM)pnS, (LPARAM)pnE))
  50. //
  51. // for compiling Unicode
  52. //
  53. #ifdef UNICODE
  54. #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
  55. #else
  56. #define SIZEOF(x) sizeof(x)
  57. #endif
  58. //
  59. // win32 apps [usually] don't have to worry about 'huge' data
  60. //
  61. #define hmemcpy memcpy
  62. #endif // #ifdef WIN32
  63. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  64. //
  65. // Win 16
  66. //
  67. //
  68. //
  69. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  70. #ifndef WIN32
  71. #ifndef FNLOCAL
  72. #ifdef CALLBACK
  73. #undef CALLBACK
  74. #endif
  75. #ifdef _WINDLL
  76. #define CALLBACK _far _pascal _loadds
  77. #else
  78. #define CALLBACK _far _pascal
  79. #endif
  80. #ifdef DEBUG
  81. #define FNLOCAL NEAR PASCAL
  82. #define FNCLOCAL NEAR _cdecl
  83. #else
  84. #define FNLOCAL static NEAR PASCAL
  85. #define FNCLOCAL static NEAR _cdecl
  86. #endif
  87. #define FNGLOBAL FAR PASCAL
  88. #define FNCGLOBAL FAR _cdecl
  89. #define FNWCALLBACK CALLBACK
  90. #define FNEXPORT CALLBACK _export
  91. #endif
  92. //
  93. // stuff for Unicode in Win 32--make it a noop in Win 16
  94. //
  95. #ifndef _TCHAR_DEFINED
  96. #define _TCHAR_DEFINED
  97. typedef char TCHAR, *PTCHAR;
  98. typedef unsigned char TBYTE, *PTUCHAR;
  99. typedef PSTR PTSTR, PTCH;
  100. typedef LPSTR LPTSTR, LPTCH;
  101. typedef LPCSTR LPCTSTR;
  102. #endif
  103. #define TEXT(a) a
  104. #define SIZEOF(x) sizeof(x)
  105. //
  106. //
  107. //
  108. #define CharNext AnsiNext
  109. #define CharPrev AnsiPrev
  110. //
  111. //
  112. //
  113. #define Edit_GetSelEx(hwndCtl, pnS, pnE) \
  114. { \
  115. DWORD dw; \
  116. dw = (DWORD)SendMessage((hwndCtl), EM_GETSEL, 0, 0L); \
  117. *pnE = (int)HIWORD(dw); \
  118. *pnS = (int)LOWORD(dw); \
  119. }
  120. //
  121. // common message cracker macros available in windowx.h on NT--these
  122. // should be added to the Win 16 windowsx.h and probably will be
  123. // in the future.
  124. //
  125. // there is a windowsx.h16 that ships with the NT PDK that defines
  126. // these macros. so if that version is being used, don't redefine
  127. // message crackers.
  128. //
  129. #ifndef WM_CTLCOLORMSGBOX
  130. #define WM_CTLCOLORMSGBOX 0x0132
  131. #define WM_CTLCOLOREDIT 0x0133
  132. #define WM_CTLCOLORLISTBOX 0x0134
  133. #define WM_CTLCOLORBTN 0x0135
  134. #define WM_CTLCOLORDLG 0x0136
  135. #define WM_CTLCOLORSCROLLBAR 0x0137
  136. #define WM_CTLCOLORSTATIC 0x0138
  137. #endif
  138. #ifndef GET_WM_ACTIVATE_STATE
  139. #define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
  140. #define GET_WM_ACTIVATE_FMINIMIZED(wp, lp) (BOOL)HIWORD(lp)
  141. #define GET_WM_ACTIVATE_HWND(wp, lp) (HWND)LOWORD(lp)
  142. #define GET_WM_ACTIVATE_MPS(s, fmin, hwnd) (WPARAM)(s), MAKELONG(hwnd, fmin)
  143. #define GET_WM_CHARTOITEM_CHAR(wp, lp) (CHAR)(wp)
  144. #define GET_WM_CHARTOITEM_POS(wp, lp) HIWORD(lp)
  145. #define GET_WM_CHARTOITEM_HWND(wp, lp) (HWND)LOWORD(lp)
  146. #define GET_WM_CHARTOITEM_MPS(ch, pos, hwnd) (WPARAM)(ch), MAKELONG(hwnd, pos)
  147. #define GET_WM_COMMAND_ID(wp, lp) (wp)
  148. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
  149. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
  150. #define GET_WM_COMMAND_MPS(id, hwnd, cmd) (WPARAM)(id), MAKELONG(hwnd, cmd)
  151. #define GET_WM_CTLCOLOR_HDC(wp, lp, msg) (HDC)(wp)
  152. #define GET_WM_CTLCOLOR_HWND(wp, lp, msg) (HWND)LOWORD(lp)
  153. #define GET_WM_CTLCOLOR_TYPE(wp, lp, msg) HIWORD(lp)
  154. #define GET_WM_CTLCOLOR_MPS(hdc, hwnd, type) (WPARAM)(hdc), MAKELONG(hwnd, type)
  155. #define GET_WM_MENUSELECT_CMD(wp, lp) (wp)
  156. #define GET_WM_MENUSELECT_FLAGS(wp, lp) LOWORD(lp)
  157. #define GET_WM_MENUSELECT_HMENU(wp, lp) (HMENU)HIWORD(lp)
  158. #define GET_WM_MENUSELECT_MPS(cmd, f, hmenu) (WPARAM)(cmd), MAKELONG(f, hmenu)
  159. // Note: the following are for interpreting MDIclient to MDI child messages.
  160. #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (BOOL)(wp)
  161. #define GET_WM_MDIACTIVATE_HWNDDEACT(wp, lp) (HWND)HIWORD(lp)
  162. #define GET_WM_MDIACTIVATE_HWNDACTIVATE(wp, lp) (HWND)LOWORD(lp)
  163. // Note: the following is for sending to the MDI client window.
  164. #define GET_WM_MDIACTIVATE_MPS(f, hwndD, hwndA) (WPARAM)(hwndA), 0
  165. #define GET_WM_MDISETMENU_MPS(hmenuF, hmenuW) 0, MAKELONG(hmenuF, hmenuW)
  166. #define GET_WM_MENUCHAR_CHAR(wp, lp) (CHAR)(wp)
  167. #define GET_WM_MENUCHAR_HMENU(wp, lp) (HMENU)LOWORD(lp)
  168. #define GET_WM_MENUCHAR_FMENU(wp, lp) (BOOL)HIWORD(lp)
  169. #define GET_WM_MENUCHAR_MPS(ch, hmenu, f) (WPARAM)(ch), MAKELONG(hmenu, f)
  170. #define GET_WM_PARENTNOTIFY_MSG(wp, lp) (wp)
  171. #define GET_WM_PARENTNOTIFY_ID(wp, lp) HIWORD(lp)
  172. #define GET_WM_PARENTNOTIFY_HWNDCHILD(wp, lp) (HWND)LOWORD(lp)
  173. #define GET_WM_PARENTNOTIFY_X(wp, lp) (INT)LOWORD(lp)
  174. #define GET_WM_PARENTNOTIFY_Y(wp, lp) (INT)HIWORD(lp)
  175. #define GET_WM_PARENTNOTIFY_MPS(msg, id, hwnd) (WPARAM)(msg), MAKELONG(hwnd, id)
  176. #define GET_WM_PARENTNOTIFY2_MPS(msg, x, y) (WPARAM)(msg), MAKELONG(x, y)
  177. #define GET_WM_VKEYTOITEM_CODE(wp, lp) (wp)
  178. #define GET_WM_VKEYTOITEM_ITEM(wp, lp) (INT)HIWORD(lp)
  179. #define GET_WM_VKEYTOITEM_HWND(wp, lp) (HWND)LOWORD(lp)
  180. #define GET_WM_VKEYTOITEM_MPS(code, item, hwnd) (WPARAM)(code), MAKELONG(hwnd, item)
  181. #define GET_EM_SETSEL_START(wp, lp) LOWORD(lp)
  182. #define GET_EM_SETSEL_END(wp, lp) HIWORD(lp)
  183. #define GET_EM_SETSEL_MPS(iStart, iEnd) 0, MAKELONG(iStart, iEnd)
  184. #define GET_EM_LINESCROLL_MPS(vert, horz) 0, MAKELONG(vert, horz)
  185. #define GET_WM_CHANGECBCHAIN_HWNDNEXT(wp, lp) (HWND)LOWORD(lp)
  186. #define GET_WM_HSCROLL_CODE(wp, lp) (wp)
  187. #define GET_WM_HSCROLL_POS(wp, lp) LOWORD(lp)
  188. #define GET_WM_HSCROLL_HWND(wp, lp) (HWND)HIWORD(lp)
  189. #define GET_WM_HSCROLL_MPS(code, pos, hwnd) (WPARAM)(code), MAKELONG(pos, hwnd)
  190. #define GET_WM_VSCROLL_CODE(wp, lp) (wp)
  191. #define GET_WM_VSCROLL_POS(wp, lp) LOWORD(lp)
  192. #define GET_WM_VSCROLL_HWND(wp, lp) (HWND)HIWORD(lp)
  193. #define GET_WM_VSCROLL_MPS(code, pos, hwnd) (WPARAM)(code), MAKELONG(pos, hwnd)
  194. #endif
  195. #endif // #ifndef WIN32
  196. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  197. //
  198. // Installable Driver Version Information:
  199. //
  200. //
  201. //
  202. // NOTE! all string resources that will be used in app.rcv for the
  203. // version resource information *MUST* have an explicit \0 terminator!
  204. //
  205. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  206. #define IDRV_VERSION_MAJOR 3
  207. #define IDRV_VERSION_MINOR 11
  208. #define IDRV_VERSION_BUILD 43
  209. #ifdef UNICODE
  210. #define IDRV_VERSION_STRING_RC "Version 3.11 (Unicode Enabled)\0"
  211. #else
  212. #define IDRV_VERSION_STRING_RC "Version 3.11\0"
  213. #endif
  214. #define IDRV_VERSION_NAME_RC "msmixmgr.dll\0"
  215. #define IDRV_VERSION_COMPANYNAME_RC "Microsoft Corporation\0"
  216. #define IDRV_VERSION_COPYRIGHT_RC "Copyright \251 Microsoft Corp. 1993\0"
  217. #define IDRV_VERSION_PRODUCTNAME_RC "Microsoft Audio Mixer Manager\0"
  218. #ifdef DEBUG
  219. #define IDRV_VERSION_DESCRIPTION_RC "Microsoft Audio Mixer Manager (debug)\0"
  220. #else
  221. #define IDRV_VERSION_DESCRIPTION_RC "Microsoft Audio Mixer Manager\0"
  222. #endif
  223. //
  224. // Unicode versions (if UNICODE is defined)... the resource compiler
  225. // cannot deal with the TEXT() macro.
  226. //
  227. #define IDRV_VERSION_STRING TEXT(IDRV_VERSION_STRING_RC)
  228. #define IDRV_VERSION_NAME TEXT(IDRV_VERSION_NAME_RC)
  229. #define IDRV_VERSION_COMPANYNAME TEXT(IDRV_VERSION_COMPANYNAME_RC)
  230. #define IDRV_VERSION_COPYRIGHT TEXT(IDRV_VERSION_COPYRIGHT_RC)
  231. #define IDRV_VERSION_PRODUCTNAME TEXT(IDRV_VERSION_PRODUCTNAME_RC)
  232. #define IDRV_VERSION_DESCRIPTION TEXT(IDRV_VERSION_DESCRIPTION_RC)
  233. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  234. //
  235. // misc defines for misc sizes and things...
  236. //
  237. //
  238. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  239. //
  240. // bilingual. this allows the same identifier to be used in resource files
  241. // and code without having to decorate the id in your code.
  242. //
  243. #ifdef RC_INVOKED
  244. #define RCID(id) id
  245. #else
  246. #define RCID(id) MAKEINTRESOURCE(id)
  247. #endif
  248. //
  249. //
  250. //
  251. #ifdef WIN32
  252. #define BSTACK
  253. #define BCODE
  254. #define BDATA
  255. #else
  256. #define BSTACK _based(_segname("_STACK"))
  257. #define BCODE _based(_segname("_CODE"))
  258. #define BDATA _based(_segname("_DATA"))
  259. #endif
  260. //
  261. //
  262. //
  263. //
  264. #define IDRV_MAX_STRING_RC_CHARS 512
  265. #define IDRV_MAX_STRING_RC_BYTES (IDRV_MAX_STRING_RC_CHARS * sizeof(TCHAR))
  266. #define IDRV_MAX_STRING_ERROR_CHARS 512
  267. #define IDRV_MAX_STRING_ERROR_BYTES (IDRV_MAX_STRING_ERROR_CHARS * sizeof(TCHAR))
  268. //
  269. // resource defines...
  270. //
  271. #define ICON_IDRV RCID(10)
  272. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  273. //
  274. //
  275. //
  276. //
  277. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  278. BOOL FNGLOBAL ProfileWriteUInt
  279. (
  280. LPCTSTR pszSection,
  281. LPCTSTR pszKey,
  282. UINT uValue
  283. );
  284. UINT FNGLOBAL ProfileReadUInt
  285. (
  286. LPCTSTR pszSection,
  287. LPCTSTR pszKey,
  288. UINT uDefault
  289. );
  290. BOOL FNGLOBAL ProfileWriteString
  291. (
  292. LPCTSTR pszSection,
  293. LPCTSTR pszKey,
  294. LPCTSTR pszValue
  295. );
  296. UINT FNGLOBAL ProfileReadString
  297. (
  298. LPCTSTR pszSection,
  299. LPCTSTR pszKey,
  300. LPCTSTR pszDefault,
  301. LPTSTR pszBuffer,
  302. UINT cbBuffer
  303. );
  304. BOOL FNGLOBAL ProfileWriteBytes
  305. (
  306. LPCTSTR pszSection,
  307. LPCTSTR pszKey,
  308. LPBYTE pbStruct,
  309. UINT cbStruct
  310. );
  311. BOOL FNGLOBAL ProfileReadBytes
  312. (
  313. LPCTSTR pszSection,
  314. LPCTSTR pszKey,
  315. LPBYTE pbStruct,
  316. UINT cbStruct
  317. );
  318. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  319. //
  320. //
  321. //
  322. //
  323. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  324. //
  325. //
  326. //
  327. #define BOGUS_DRIVER_ID 1L
  328. //
  329. //
  330. //
  331. //
  332. typedef struct tIDRVINST
  333. {
  334. HDRVR hdrvr; // driver handle we were opened with
  335. } IDRVINST, *PIDRVINST, FAR *LPIDRVINST;
  336. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  337. //
  338. //
  339. //
  340. //
  341. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  342. LRESULT FNGLOBAL IDrvLoad
  343. (
  344. HDRVR hdrvr
  345. );
  346. LRESULT FNGLOBAL IDrvFree
  347. (
  348. HDRVR hdrvr
  349. );
  350. LRESULT FNGLOBAL IDrvEnable
  351. (
  352. HDRVR hdrvr
  353. );
  354. LRESULT FNGLOBAL IDrvDisable
  355. (
  356. HDRVR hdrvr
  357. );
  358. LRESULT FNGLOBAL IDrvExitSession
  359. (
  360. PIDRVINST pidi
  361. );
  362. LRESULT FNGLOBAL IDrvConfigure
  363. (
  364. PIDRVINST pidi,
  365. HWND hwnd,
  366. LPDRVCONFIGINFO pdci
  367. );
  368. LRESULT FNGLOBAL IDrvInstall
  369. (
  370. PIDRVINST pidi,
  371. LPDRVCONFIGINFO pdci
  372. );
  373. LRESULT FNGLOBAL IDrvRemove
  374. (
  375. PIDRVINST pidi
  376. );
  377. //
  378. // defines for gfuIDrvFlags
  379. //
  380. //
  381. #define IDRVF_FIRSTLOAD 0x0001
  382. #define IDRVF_ENABLED 0x0002
  383. //
  384. // defines for gfuIDrvOptions
  385. //
  386. //
  387. #define IDRV_OPTF_ZYZSMAG 0x0001
  388. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  389. //
  390. // global variables
  391. //
  392. //
  393. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  394. extern HINSTANCE ghinstIDrv;
  395. extern UINT gfuIDrvFlags;
  396. extern UINT gfuIDrvOptions;
  397. extern TCHAR gszIDrvSecConfig[];
  398. extern TCHAR gszNull[];
  399. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  400. //
  401. //
  402. //
  403. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  404. #ifndef RC_INVOKED
  405. #pragma pack() // revert to default packing
  406. #endif
  407. #ifdef __cplusplus
  408. } // end of extern "C" {
  409. #endif
  410. #endif // _INC_IDRV