Windows NT 4.0 source code leak
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.

323 lines
8.6 KiB

4 years ago
  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1993 - 1995 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // codec.h
  13. //
  14. // Description:
  15. // This file contains codec definitions, Win16/Win32 compatibility
  16. // definitions, and instance structure definitions.
  17. //
  18. //
  19. //==========================================================================;
  20. #ifndef _INC_CODEC
  21. #define _INC_CODEC // #defined if codec.h has been included
  22. #ifndef RC_INVOKED
  23. #pragma pack(1) // assume byte packing throughout
  24. #endif
  25. #ifndef EXTERN_C
  26. #ifdef __cplusplus
  27. #define EXTERN_C extern "C"
  28. #else
  29. #define EXTERN_C extern
  30. #endif
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" // assume C declarations for C++
  34. {
  35. #endif
  36. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  37. //
  38. // ACM Driver Version:
  39. //
  40. // the version is a 32 bit number that is broken into three parts as
  41. // follows:
  42. //
  43. // bits 24 - 31: 8 bit _major_ version number
  44. // bits 16 - 23: 8 bit _minor_ version number
  45. // bits 0 - 15: 16 bit build number
  46. //
  47. // this is then displayed as follows (in decimal form):
  48. //
  49. // bMajor = (BYTE)(dwVersion >> 24)
  50. // bMinor = (BYTE)(dwVersion >> 16) &
  51. // wBuild = LOWORD(dwVersion)
  52. //
  53. // VERSION_ACM_DRIVER is the version of this driver.
  54. // VERSION_MSACM is the version of the ACM that this driver
  55. // was designed for (requires).
  56. //
  57. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  58. #ifdef _WIN32
  59. //
  60. // 32-bit versions
  61. //
  62. #if (WINVER >= 0x0400)
  63. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(4, 0, 0)
  64. #else
  65. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(3, 50, 0)
  66. #endif
  67. #define VERSION_MSACM MAKE_ACM_VERSION(3, 50, 0)
  68. #else
  69. //
  70. // 16-bit versions
  71. //
  72. #define VERSION_ACM_DRIVER MAKE_ACM_VERSION(1, 0, 0)
  73. #define VERSION_MSACM MAKE_ACM_VERSION(2, 1, 0)
  74. #endif
  75. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  76. //
  77. // Win 16/32 portability stuff...
  78. //
  79. //
  80. //
  81. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  82. #ifndef _WIN32
  83. #ifndef FNLOCAL
  84. #define FNLOCAL NEAR PASCAL
  85. #define FNCLOCAL NEAR _cdecl
  86. #define FNGLOBAL FAR PASCAL
  87. #define FNCGLOBAL FAR _cdecl
  88. #ifdef _WINDLL
  89. #define FNWCALLBACK FAR PASCAL _loadds
  90. #define FNEXPORT FAR PASCAL _export
  91. #else
  92. #define FNWCALLBACK FAR PASCAL
  93. #define FNEXPORT FAR PASCAL _export
  94. #endif
  95. #endif
  96. //
  97. //
  98. //
  99. //
  100. #ifndef FIELD_OFFSET
  101. #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
  102. #endif
  103. //
  104. // based code makes since only in win 16 (to try and keep stuff out of
  105. // our fixed data segment...
  106. //
  107. #define BCODE _based(_segname("_CODE"))
  108. #define HUGE _huge
  109. //
  110. // stuff for Unicode in Win 32--make it a noop in Win 16
  111. //
  112. #ifndef _TCHAR_DEFINED
  113. #define _TCHAR_DEFINED
  114. typedef char TCHAR, *PTCHAR;
  115. typedef unsigned char TBYTE, *PTUCHAR;
  116. typedef PSTR PTSTR, PTCH;
  117. typedef LPSTR LPTSTR, LPTCH;
  118. typedef LPCSTR LPCTSTR;
  119. #endif
  120. #define TEXT(a) a
  121. #define SIZEOF(x) sizeof(x)
  122. #define SIZEOFACMSTR(x) sizeof(x)
  123. #else
  124. #ifndef FNLOCAL
  125. #define FNLOCAL _stdcall
  126. #define FNCLOCAL _stdcall
  127. #define FNGLOBAL _stdcall
  128. #define FNCGLOBAL _stdcall
  129. #define FNWCALLBACK CALLBACK
  130. #define FNEXPORT CALLBACK
  131. #endif
  132. #ifndef _CRTAPI1
  133. #define _CRTAPI1 __cdecl
  134. #endif
  135. #ifndef _CRTAPI2
  136. #define _CRTAPI2 __cdecl
  137. #endif
  138. #ifndef try
  139. #define try __try
  140. #define leave __leave
  141. #define except __except
  142. #define finally __finally
  143. #endif
  144. //
  145. // there is no reason to have based stuff in win 32
  146. //
  147. #define BCODE
  148. #define HUGE
  149. #define HTASK HANDLE
  150. #define SELECTOROF(a) (a)
  151. typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
  152. //
  153. // for compiling Unicode
  154. //
  155. #ifdef UNICODE
  156. #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
  157. #else
  158. #define SIZEOF(x) sizeof(x)
  159. #endif
  160. #define SIZEOFACMSTR(x) (sizeof(x)/sizeof(WCHAR))
  161. #endif
  162. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  163. //
  164. // misc defines for misc sizes and things...
  165. //
  166. //
  167. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  168. //
  169. // bilingual. this allows the same identifier to be used in resource files
  170. // and code without having to decorate the id in your code.
  171. //
  172. #ifdef RC_INVOKED
  173. #define RCID(id) id
  174. #else
  175. #define RCID(id) MAKEINTRESOURCE(id)
  176. #endif
  177. //
  178. //
  179. //
  180. #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0]))
  181. //
  182. // macros to compute block alignment and convert between samples and bytes
  183. // of PCM data. note that these macros assume:
  184. //
  185. // wBitsPerSample = 8 or 16
  186. // nChannels = 1 or 2
  187. //
  188. // the pwf argument is a pointer to a PCMWAVEFORMAT structure.
  189. //
  190. #define PCM_BLOCKALIGNMENT(pwf) (UINT)(((pwf)->wBitsPerSample >> 3) << ((pwf)->wf.nChannels >> 1))
  191. #define PCM_AVGBYTESPERSEC(pwf) (DWORD)((pwf)->wf.nSamplesPerSec * (pwf)->wf.nBlockAlign)
  192. #define PCM_BYTESTOSAMPLES(pwf, dw) (DWORD)(dw / PCM_BLOCKALIGNMENT(pwf))
  193. #define PCM_SAMPLESTOBYTES(pwf, dw) (DWORD)(dw * PCM_BLOCKALIGNMENT(pwf))
  194. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  195. //
  196. //
  197. //
  198. //
  199. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  200. typedef struct tDRIVERINSTANCE
  201. {
  202. //
  203. // although not required, it is suggested that the first two members
  204. // of this structure remain as fccType and DriverProc _in this order_.
  205. // the reason for this is that the driver will be easier to combine
  206. // with other types of drivers (defined by AVI) in the future.
  207. //
  208. FOURCC fccType; // type of driver: 'audc'
  209. DRIVERPROC fnDriverProc; // driver proc for the instance
  210. //
  211. // the remaining members of this structure are entirely open to what
  212. // your driver requires.
  213. //
  214. HDRVR hdrvr; // driver handle we were opened with
  215. HINSTANCE hinst; // DLL module handle.
  216. DWORD vdwACM; // current version of ACM opening you
  217. DWORD fdwOpen; // flags from open description
  218. DWORD fdwConfig; // driver instance configuration flags
  219. } DRIVERINSTANCE, *PDRIVERINSTANCE, FAR *LPDRIVERINSTANCE;
  220. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  221. //
  222. //
  223. //
  224. //
  225. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  226. //
  227. //
  228. //
  229. //
  230. typedef LRESULT (FNGLOBAL *STREAMCONVERTPROC)
  231. (
  232. LPACMDRVSTREAMINSTANCE padsi,
  233. LPACMDRVSTREAMHEADER padsh
  234. );
  235. //
  236. //
  237. //
  238. //
  239. typedef struct tSTREAMINSTANCE
  240. {
  241. STREAMCONVERTPROC fnConvert; // stream instance conversion proc
  242. DWORD fdwConfig; // stream instance configuration flags
  243. } STREAMINSTANCE, *PSTREAMINSTANCE, FAR *LPSTREAMINSTANCE;
  244. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  245. //
  246. // resource id's
  247. //
  248. //
  249. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  250. #define IDS_ACM_DRIVER_SHORTNAME (1) // ACMDRIVERDETAILS.szShortName
  251. #define IDS_ACM_DRIVER_LONGNAME (2) // ACMDRIVERDETAILS.szLongName
  252. #define IDS_ACM_DRIVER_COPYRIGHT (3) // ACMDRIVERDETAILS.szCopyright
  253. #define IDS_ACM_DRIVER_LICENSING (4) // ACMDRIVERDETAILS.szLicensing
  254. #define IDS_ACM_DRIVER_FEATURES (5) // ACMDRIVERDETAILS.szFeatures
  255. #define IDS_ACM_DRIVER_TAG_NAME_ALAW (20) // ACMFORMATTAGDETAILS.szFormatTag
  256. #define IDS_ACM_DRIVER_TAG_NAME_MULAW (30) // ACMFORMATTAGDETAILS.szFormatTag
  257. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  258. //
  259. //
  260. //
  261. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  262. #ifndef RC_INVOKED
  263. #pragma pack() // revert to default packing
  264. #endif
  265. #ifdef __cplusplus
  266. } // end of extern "C" {
  267. #endif
  268. #endif // _INC_CODEC