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.

198 lines
4.1 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. // Retrieve the OS version and architecture
  49. // information.
  50. //
  51. os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  52. GetSystemInfo(&si);
  53. GetVersionEx(&os);
  54. // Build our client-info return values.
  55. //
  56. bMaj = (BYTE)(LOWORD(os.dwMajorVersion));
  57. bMin = (BYTE)(LOWORD(os.dwMinorVersion));
  58. bPlat = (BYTE)(LOWORD(os.dwPlatformId));
  59. bArch = (BYTE)(LOBYTE(si.wProcessorArchitecture));
  60. return webMakeOSInfo(bArch, bPlat, bMaj, bMin);
  61. }
  62. /*-----------------------------------*\
  63. | webGetOSArch
  64. |
  65. | Returns architecture of os-info.
  66. |
  67. \*-----------------------------------*/
  68. _inline WORD webGetOSArch(
  69. DWORD dwInfo)
  70. {
  71. return (WORD)LOBYTE(LOWORD(dwInfo));
  72. }
  73. /*-----------------------------------*\
  74. | webGetOSPlatform
  75. |
  76. | Returns platform of os-info.
  77. |
  78. \*-----------------------------------*/
  79. _inline DWORD webGetOSPlatform(
  80. DWORD dwInfo)
  81. {
  82. return (DWORD)HIBYTE(LOWORD(dwInfo));
  83. }
  84. /*-----------------------------------*\
  85. | webGetOSMajorVer
  86. |
  87. | Returns major version of os-info.
  88. |
  89. \*-----------------------------------*/
  90. _inline DWORD webGetOSMajorVer(
  91. DWORD dwInfo)
  92. {
  93. return (DWORD)(HIBYTE(HIWORD(dwInfo)));
  94. }
  95. /*-----------------------------------*\
  96. | webGetOSMinorVer
  97. |
  98. | Returns minor version of os-info.
  99. |
  100. \*-----------------------------------*/
  101. _inline DWORD webGetOSMinorVer(
  102. DWORD dwInfo)
  103. {
  104. return (DWORD)(LOBYTE(HIWORD(dwInfo)));
  105. }
  106. #ifdef __cplusplus // Place this here to prevent decorating of symbols
  107. extern "C" { // when doing C++ stuff.
  108. #endif //
  109. // WEB_FILEMAP
  110. //
  111. typedef struct _WEB_FILEMAP {
  112. HANDLE hFile;
  113. HANDLE hMap;
  114. } WEB_FILEMAP;
  115. typedef WEB_FILEMAP *PWEB_FILEMAP;
  116. typedef WEB_FILEMAP NEAR *NPWEB_FILEMAP;
  117. typedef WEB_FILEMAP FAR *LPWEB_FILEMAP;
  118. // Device-Bin Header Structure.
  119. //
  120. typedef struct _DEVBIN_HEAD {
  121. BOOL bDevMode;
  122. DWORD cItems;
  123. } DEVBIN_HEAD;
  124. typedef DEVBIN_HEAD *PDEVBIN_HEAD;
  125. typedef DEVBIN_HEAD NEAR *NPDEVBIN_HEAD;
  126. typedef DEVBIN_HEAD FAR *LPDEVBIN_HEAD;
  127. // Device-Bin Structure.
  128. //
  129. typedef struct _DEVBIN_INFO {
  130. DWORD cbSize;
  131. DWORD dwType;
  132. DWORD pKey;
  133. DWORD pValue;
  134. DWORD pData;
  135. DWORD cbData;
  136. } DEVBIN_INFO;
  137. typedef DEVBIN_INFO *PDEVBIN_INFO;
  138. typedef DEVBIN_INFO NEAR *NPDEVBIN_INFO;
  139. typedef DEVBIN_INFO FAR *LPDEVBIN_INFO;
  140. // BIN-Routines.
  141. //
  142. #define WEB_ENUM_KEY 0
  143. #define WEB_ENUM_ICM 1
  144. typedef BOOL (CALLBACK* WEBENUMKEYPROC)(LPCTSTR, LPVOID);
  145. typedef BOOL (CALLBACK* WEBENUMICMPROC)(LPCTSTR, LPCTSTR, LPVOID);
  146. typedef BOOL (CALLBACK* WEBGENCOPYFILEPATHPROC)(LPCWSTR, LPCWSTR, LPBYTE, DWORD, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD);
  147. BOOL webWritePrinterInfo(HANDLE, LPCTSTR);
  148. BOOL webReadPrinterInfo(HANDLE, LPCTSTR, LPCTSTR);
  149. BOOL webEnumPrinterInfo(HANDLE, DWORD, DWORD, FARPROC, LPVOID);
  150. // SplLib Exports.
  151. //
  152. BOOL WebPnpEntry(LPCTSTR);
  153. BOOL WebPnpPostEntry(BOOL, LPCTSTR, LPCTSTR, LPCTSTR);
  154. #ifdef __cplusplus // Place this here to prevent decorating of symbols
  155. } // when doing C++ stuff.
  156. #endif //
  157. #endif