home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / devload.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  5.5 KB  |  141 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. devload.h
  11.  
  12. Abstract:
  13.  
  14. Device loader structures and defines
  15.  
  16. Notes: 
  17.  
  18.  
  19. --*/
  20.  
  21. #ifndef __DEVLOAD_H_
  22. #define __DEVLOAD_H_
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. //
  29. // These keys are under HKEY_LOCAL_MACHINE
  30. //
  31. #define DEVLOAD_BUILT_IN_KEY TEXT("Drivers\\BuiltIn")
  32. #define DEVLOAD_PCMCIA_KEY   TEXT("Drivers\\PCMCIA")
  33. #define DEVLOAD_ACTIVE_KEY   TEXT("Drivers\\Active")
  34. #define DEVLOAD_DETECT_KEY   DEVLOAD_PCMCIA_KEY TEXT("\\Detect")
  35.  
  36. //
  37. // These are the required and optional values under a device key.
  38. // - If the entrypoint name is present, then it will be called and the device
  39. // DLL is responsible to call RegisterDevice.
  40. // When the entrypoint name is not present, DEVLOAD will call RegisterDevice on
  41. // behalf of the device and will increment the device index appropriately.  In
  42. // this case, the device prefix must be present.
  43. // - If the context value is present, then it will be passed as the dwInfo parameter
  44. // to RegisterDevice.  If it is not present, then a handle to the device's registry
  45. // will be passed in dwInfo.
  46. // - If the init code value is present it indicates the I/O control code to use in a
  47. // call to the device's DeviceIoControl function to indicate that the device has been
  48. // initialized.  This provides a context for the device driver to load another driver
  49. // which uses its device.
  50. //
  51. #define DEVLOAD_DLLNAME_VALNAME      TEXT("Dll")     // DLL name (required)
  52. #define DEVLOAD_DLLNAME_VALTYPE      REG_SZ
  53. #define DEVLOAD_LOADORDER_VALNAME    TEXT("Order")   // LoadOrder (required)
  54. #define DEVLOAD_LOADORDER_VALTYPE    REG_DWORD
  55. #define DEVLOAD_ENTRYPOINT_VALNAME   TEXT("Entry")   // Entrypoint name (optional)
  56. #define DEVLOAD_ENTRYPOINT_VALTYPE   REG_SZ
  57. #define DEVLOAD_PREFIX_VALNAME       TEXT("Prefix")  // Device prefix (optional)
  58. #define DEVLOAD_PREFIX_VALTYPE       REG_SZ
  59. #define DEVLOAD_INDEX_VALNAME        TEXT("Index")   // Device index (optional)
  60. #define DEVLOAD_INDEX_VALTYPE        REG_DWORD
  61. #define DEVLOAD_CONTEXT_VALNAME      TEXT("Context") // Device context (optional)
  62. #define DEVLOAD_CONTEXT_VALTYPE      REG_DWORD
  63. #define DEVLOAD_INITCODE_VALNAME     TEXT("Ioctl")   // Device IO control code to indicate context (optional)
  64. #define DEVLOAD_INITCODE_VALTYPE     REG_DWORD
  65.  
  66. //
  67. // The presence of the value "Keep" will cause device.exe to skip the call to
  68. // FreeLibrary after calling the specified entrypoint.  This only affects
  69. // builtin drivers that specify an entrypoint.
  70. //
  71. #define DEVLOAD_KEEPLIB_VALNAME      TEXT("Keep")
  72. #define DEVLOAD_KEEPLIB_VALTYPE      REG_DWORD
  73.  
  74. //
  75. // Structure passed in the input buffer of DeviceIoControl() for the 
  76. // post initialization ioctl
  77. //
  78. typedef struct _POST_INIT_BUF {
  79.     HANDLE p_hDevice;        // device handle from RegisterDevice
  80.     HKEY   p_hDeviceKey;     // open registry handle to the driver's device key
  81. } POST_INIT_BUF, *PPOST_INIT_BUF;
  82.  
  83. //
  84. // These values reside under a device's active key
  85. //
  86. #define DEVLOAD_HANDLE_VALNAME      TEXT("Hnd")     // Device handle (from RegisterDevice)
  87. #define DEVLOAD_HANDLE_VALTYPE      REG_DWORD
  88. #define DEVLOAD_DEVNAME_VALNAME     TEXT("Name")    // Device name (i.e "COM1:")
  89. #define DEVLOAD_DEVNAME_VALTYPE     REG_SZ
  90. #define DEVLOAD_DEVKEY_VALNAME      TEXT("Key")     // Device key in \Drivers\(Built-In or PCMCIA)
  91. #define DEVLOAD_DEVKEY_VALTYPE      REG_SZ
  92. #define DEVLOAD_PNPID_VALNAME       TEXT("PnpId")   // Plug and Play Id (PCMCIA, optional)
  93. #define DEVLOAD_PNPID_VALTYPE       REG_SZ
  94. #define DEVLOAD_SOCKET_VALNAME      TEXT("Sckt")    // PCMCIA socket (optional)
  95. #define DEVLOAD_SOCKET_VALTYPE      REG_DWORD       // Actually a CARD_SOCKET_HANDLE   
  96.  
  97. //
  98. // TAPI Pnp support
  99. //
  100. #define DEVLOAD_TSPDLL_VALNAME      TEXT("Tsp")     // TAPI Service Provider DLL
  101. #define DEVLOAD_TSPDLL_VALTYPE      REG_SZ
  102. #define DEVLOAD_TSPDEV_VALNAME      TEXT("THnd")    // TAPI device index
  103. #define DEVLOAD_TSPDEV_VALTYPE      REG_DWORD
  104.  
  105. //
  106. // Prototype for the optional device driver entrypoint
  107. //
  108. typedef DWORD (*PFN_DEV_ENTRY)(LPTSTR);     // Parameter is registry path of device's key
  109.  
  110. //
  111. // Prototype for the detection function.
  112. //
  113. // Return is NULL for undetected or pointer to the device key under HLM\Drivers\PCMCIA
  114. // of the device driver to load for a detected card.
  115. //
  116. typedef LPTSTR (*PFN_DETECT_ENTRY)(
  117.                     CARD_SOCKET_HANDLE, // Socket containing the card to detect
  118.                     UCHAR,              // Device type from CISTPL_FUNCID or 0xff for unknown
  119.                     LPTSTR,             // Buffer to put name of device key
  120.                     DWORD);             // Number of characters in buffer parameter
  121.  
  122. #define DEVNAME_LEN     16  // Max length of device name
  123. #define DEVDLL_LEN      64  // Max length of device driver DLL name
  124. #define DEVENTRY_LEN    64  // Max length of device driver entrypoint name
  125. #define DEVPREFIX_LEN    8  // Max length of device prefix
  126.  
  127. //
  128. // Device APIs: EnumPnpIds, EnumDevices and GetDeviceKeys (in coredll.dll)
  129. //
  130. DWORD EnumPnpIds(LPTSTR PnpList, LPDWORD lpBuflen);
  131. DWORD EnumDevices(LPTSTR DevList, LPDWORD lpBuflen);
  132. DWORD GetDeviceKeys(LPCTSTR DevName, LPTSTR ActiveKey, LPDWORD lpActiveLen,
  133.                                      LPTSTR DriverKey, LPDWORD lpDriverLen);
  134.  
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138.  
  139. #endif //__DEVLOAD_H__
  140.  
  141.