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.

198 lines
4.3 KiB

  1. /*****************************************************************************\
  2. * MODULE: webpnp.h
  3. *
  4. * This is the header module for webpnp.c. This contains the routines
  5. * necessary for processing .BIN files.
  6. *
  7. *
  8. * Copyright (C) 1996-1997 Microsoft Corporation
  9. * Copyright (C) 1996-1997 Hewlett Packard
  10. *
  11. * history:
  12. * 25-Feb-1997 <chriswil> created.
  13. *
  14. \*****************************************************************************/
  15. #ifndef _WEBPNP_H
  16. #define _WEBPNP_H
  17. #ifndef _WINSPOOL_
  18. #include <winspool.h>
  19. #endif
  20. /*-----------------------------------*\
  21. | webMakeOSInfo
  22. |
  23. | Returns OSInfo from parameters.
  24. |
  25. \*-----------------------------------*/
  26. _inline DWORD webMakeOSInfo(
  27. BYTE bArch,
  28. BYTE bPlatform,
  29. BYTE bMajVer,
  30. BYTE bMinVer)
  31. {
  32. return (DWORD)MAKELONG(MAKEWORD(bArch, bPlatform), MAKEWORD(bMinVer, bMajVer));
  33. }
  34. /*-----------------------------------*\
  35. | webCreateOSInfo
  36. |
  37. | Builds an OS Info DWORD.
  38. |
  39. \*-----------------------------------*/
  40. _inline DWORD webCreateOSInfo(VOID)
  41. {
  42. SYSTEM_INFO si;
  43. OSVERSIONINFO os;
  44. BYTE bMaj;
  45. BYTE bMin;
  46. BYTE bArch;
  47. BYTE bPlat;
  48. //
  49. // Retrieve the OS version and architecture
  50. // information.
  51. //
  52. os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  53. GetSystemInfo(&si);
  54. GetVersionEx(&os);
  55. //
  56. // Build our client-info return values.
  57. //
  58. bMaj = (BYTE)(LOWORD(os.dwMajorVersion));
  59. bMin = (BYTE)(LOWORD(os.dwMinorVersion));
  60. bPlat = (BYTE)(LOWORD(os.dwPlatformId));
  61. bArch = (BYTE)(LOBYTE(si.wProcessorArchitecture));
  62. return webMakeOSInfo(bArch, bPlat, bMaj, bMin);
  63. }
  64. /*-----------------------------------*\
  65. | webGetOSArch
  66. |
  67. | Returns architecture of os-info.
  68. |
  69. \*-----------------------------------*/
  70. _inline WORD webGetOSArch(
  71. DWORD dwInfo)
  72. {
  73. return (WORD)LOBYTE(LOWORD(dwInfo));
  74. }
  75. /*-----------------------------------*\
  76. | webGetOSPlatform
  77. |
  78. | Returns platform of os-info.
  79. |
  80. \*-----------------------------------*/
  81. _inline DWORD webGetOSPlatform(
  82. DWORD dwInfo)
  83. {
  84. return (DWORD)HIBYTE(LOWORD(dwInfo));
  85. }
  86. /*-----------------------------------*\
  87. | webGetOSMajorVer
  88. |
  89. | Returns major version of os-info.
  90. |
  91. \*-----------------------------------*/
  92. _inline DWORD webGetOSMajorVer(
  93. DWORD dwInfo)
  94. {
  95. return (DWORD)(HIBYTE(HIWORD(dwInfo)));
  96. }
  97. /*-----------------------------------*\
  98. | webGetOSMinorVer
  99. |
  100. | Returns minor version of os-info.
  101. |
  102. \*-----------------------------------*/
  103. _inline DWORD webGetOSMinorVer(
  104. DWORD dwInfo)
  105. {
  106. return (DWORD)(LOBYTE(HIWORD(dwInfo)));
  107. }
  108. #ifdef __cplusplus // Place this here to prevent decorating of symbols
  109. extern "C" { // when doing C++ stuff.
  110. #endif //
  111. //
  112. // WEB_FILEMAP
  113. //
  114. typedef struct _WEB_FILEMAP {
  115. HANDLE hFile;
  116. HANDLE hMap;
  117. } WEB_FILEMAP;
  118. typedef WEB_FILEMAP *PWEB_FILEMAP;
  119. typedef WEB_FILEMAP NEAR *NPWEB_FILEMAP;
  120. typedef WEB_FILEMAP FAR *LPWEB_FILEMAP;
  121. //
  122. // Device-Bin Header Structure.
  123. //
  124. typedef struct _DEVBIN_HEAD {
  125. BOOL bDevMode;
  126. DWORD cItems;
  127. } DEVBIN_HEAD;
  128. typedef DEVBIN_HEAD *PDEVBIN_HEAD;
  129. typedef DEVBIN_HEAD NEAR *NPDEVBIN_HEAD;
  130. typedef DEVBIN_HEAD FAR *LPDEVBIN_HEAD;
  131. //
  132. // Device-Bin Structure.
  133. //
  134. typedef struct _DEVBIN_INFO {
  135. DWORD cbSize;
  136. DWORD dwType;
  137. DWORD pKey;
  138. DWORD pValue;
  139. DWORD pData;
  140. DWORD cbData;
  141. } DEVBIN_INFO;
  142. typedef DEVBIN_INFO *PDEVBIN_INFO;
  143. typedef DEVBIN_INFO NEAR *NPDEVBIN_INFO;
  144. typedef DEVBIN_INFO FAR *LPDEVBIN_INFO;
  145. //
  146. // BIN-Routines.
  147. //
  148. #define WEB_ENUM_KEY 0
  149. #define WEB_ENUM_ICM 1
  150. typedef BOOL (CALLBACK* WEBENUMKEYPROC)(LPCTSTR, LPVOID);
  151. typedef BOOL (CALLBACK* WEBENUMICMPROC)(LPCTSTR, LPCTSTR, LPVOID);
  152. typedef BOOL (CALLBACK* WEBGENCOPYFILEPATHPROC)(LPCWSTR, LPCWSTR, LPBYTE, DWORD, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD);
  153. BOOL webWritePrinterInfo(HANDLE, LPCTSTR);
  154. BOOL webReadPrinterInfo(HANDLE, LPCTSTR, LPCTSTR);
  155. BOOL webEnumPrinterInfo(HANDLE, DWORD, DWORD, FARPROC, LPVOID);
  156. //
  157. // SplLib Exports.
  158. //
  159. BOOL WebPnpEntry(LPCTSTR);
  160. BOOL WebPnpPostEntry(BOOL, LPCTSTR, LPCTSTR, LPCTSTR);
  161. #ifdef __cplusplus // Place this here to prevent decorating of symbols
  162. } // when doing C++ stuff.
  163. #endif //
  164. #endif