Announcement

Collapse
1 of 2 < >

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
2 of 2 < >

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

List USB info (VID, PID,Revision, etc)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • List USB info (VID, PID,Revision, etc)

    This is my sample for obtaining Vendor Id, Product Id, and other information from USB drivers. It is based around the "SetupApi.INC" file from Kev Peel (that can be downloaded from the Pb Files section)
    There is a great wealth of information that can be gathered but for this example I am only after information like
    HardWare Id = PCI\VEN_8086&DEV_27C8&SUBSYS_50041458&REV_01

    Device Type = PCI
    Vendor Id = 8086
    Product Id = 27C8
    SubSystem = 50041458
    Revision = 01
    I hope this is of some use
    discussion on this code can be found in the forums under List USB info (VID, PID,Revision, etc)

    SetupApiClassInfo.INC
    Code:
    '**************************************************************************************************
    '*** Programmer: Cliff Nichols
    '*** Concept: Wrapper for Kev Peel's "SetupApi.INC"
    '*** Date: 12-14-07
    '*** Last Update: 12-15-07
    '*** Special Thanks:
    '***      Kev Peel for SetupApi.INC
    '***      Walt Decker, José Roca, Knuth Konrad and others for their reminders of concepts that
    '***            are often overlooked (see "Parameter as Reply" discussion for more)
    '**************************************************************************************************
    
    ________________________________________________________________________________________
    '
    '  Device Viewer
    '  -------------
    '
    '  Win 95 must have IE4 installed and NT4 must have SP3 or later installed.
    '________________________________________________________________________________________
    
    ''  Note that SPDRP codes are zero based while CM_DRP codes are one based!
    '
    '%SPDRP_DEVICEDESC                  = (&H00000000)  '  DeviceDesc (R/W)
    '%SPDRP_HARDWAREID                  = (&H00000001)  '  HardwareID (R/W)
    '%SPDRP_COMPATIBLEIDS               = (&H00000002)  '  CompatibleIDs (R/W)
    '%SPDRP_UNUSED0                     = (&H00000003)  '  unused
    '%SPDRP_SERVICE                     = (&H00000004)  '  Service (R/W)
    '%SPDRP_UNUSED1                     = (&H00000005)  '  unused
    '%SPDRP_UNUSED2                     = (&H00000006)  '  unused
    '%SPDRP_CLASS                       = (&H00000007)  '  Class (R--tied to ClassGUID)
    '%SPDRP_CLASSGUID                   = (&H00000008)  '  ClassGUID (R/W)
    '%SPDRP_DRIVER                      = (&H00000009)  '  Driver (R/W)
    '%SPDRP_CONFIGFLAGS                 = (&H0000000A)  '  ConfigFlags (R/W)
    '%SPDRP_MFG                         = (&H0000000B)  '  Mfg (R/W)
    '%SPDRP_FRIENDLYNAME                = (&H0000000C)  '  FriendlyName (R/W)
    '%SPDRP_LOCATION_INFORMATION        = (&H0000000D)  '  LocationInformation (R/W)
    '%SPDRP_PHYSICAL_DEVICE_OBJECT_NAME  =(&H0000000E)  '  PhysicalDeviceObjectName (R)
    '%SPDRP_CAPABILITIES                = (&H0000000F)  '  Capabilities (R)
    '%SPDRP_UI_NUMBER                   = (&H00000010)  '  UiNumber (R)
    '%SPDRP_UPPERFILTERS                = (&H00000011)  '  UpperFilters (R/W)
    '%SPDRP_LOWERFILTERS                = (&H00000012)  '  LowerFilters (R/W)
    '%SPDRP_BUSTYPEGUID                 = (&H00000013)  '  BusTypeGUID (R)
    '%SPDRP_LEGACYBUSTYPE               = (&H00000014)  '  LegacyBusType (R)
    '%SPDRP_BUSNUMBER                   = (&H00000015)  '  BusNumber (R)
    '%SPDRP_ENUMERATOR_NAME             = (&H00000016)  '  Enumerator Name (R)
    '%SPDRP_SECURITY                    = (&H00000017)  '  Security (R/W, binary form)
    '%SPDRP_SECURITY_SDS                = (&H00000018)  '  Security (W, SDS form)
    '%SPDRP_DEVTYPE                     = (&H00000019)  '  Device Type (R/W)
    '%SPDRP_EXCLUSIVE                   = (&H0000001A)  '  Device is exclusive-access (R/W)
    '%SPDRP_CHARACTERISTICS             = (&H0000001B)  '  Device Characteristics (R/W)
    '%SPDRP_ADDRESS                     = (&H0000001C)  '  Device Address (R)
    '%SPDRP_UI_NUMBER_DESC_FORMAT       = (&H0000001D)  '  UiNumberDescFormat (R/W)
    '%SPDRP_DEVICE_POWER_DATA           = (&H0000001E)  '  Device Power Data (R)
    '%SPDRP_REMOVAL_POLICY              = (&H0000001F)  '  Removal Policy (R)
    '%SPDRP_REMOVAL_POLICY_HW_DEFAULT   = (&H00000020)  '  Hardware Removal Policy (R)
    '%SPDRP_REMOVAL_POLICY_OVERRIDE     = (&H00000021)  '  Removal Policy Override (RW)
    '%SPDRP_INSTALL_STATE               = (&H00000022)  '  Device Install State (R)
    '%SPDRP_LOCATION_PATHS              = (&H00000023)  '  Device Location Paths (R)
    '
    '%SPDRP_MAXIMUM_PROPERTY            = (&H00000024)  '  Upper bound on ordinals
    
    #IF NOT %DEF(%SETUPAPI)
         #INCLUDE "SetupApi.INC"                           'This wrapper relies on Kev Peel's "SetupApi.INC" file
    #ENDIF
    
    '---------------------------------------- TYPES ------------------------------------------------------
    TYPE DeviceDriver                  'Type to hold Driver info
         ClassName                     AS ASCIIZ * %MAX_PATH
         FriendlyName                  AS ASCIIZ * %MAX_PATH
         DeviceDesc                    AS ASCIIZ * %MAX_PATH
         HardwareId                    AS ASCIIZ * %MAX_PATH
         CompatibleId                  AS ASCIIZ * %MAX_PATH
         Unused0                       AS ASCIIZ * %MAX_PATH
         Service                       AS ASCIIZ * %MAX_PATH
         Unused1                       AS ASCIIZ * %MAX_PATH
         Unused2                       AS ASCIIZ * %MAX_PATH
         ClassGuid                     AS ASCIIZ * %MAX_PATH
         Driver                        AS ASCIIZ * %MAX_PATH
         ConfigFlags                   AS ASCIIZ * %MAX_PATH
         Mfg                           AS ASCIIZ * %MAX_PATH
         Location                      AS ASCIIZ * %MAX_PATH
         ObjectName                    AS ASCIIZ * %MAX_PATH
         Capabilities                  AS ASCIIZ * %MAX_PATH
         UiNumber                      AS ASCIIZ * %MAX_PATH
         UpperFilters                  AS ASCIIZ * %MAX_PATH
         LowerFilters                  AS ASCIIZ * %MAX_PATH
         BusTypeGuid                   AS ASCIIZ * %MAX_PATH
         LegacyBusType                 AS ASCIIZ * %MAX_PATH
         BusNumber                     AS ASCIIZ * %MAX_PATH
         EnumeratorName                AS ASCIIZ * %MAX_PATH
         SecurityBinary                AS ASCIIZ * %MAX_PATH
         SecuritySelfDirectedSearch    AS ASCIIZ * %MAX_PATH
         DeviceType                    AS ASCIIZ * %MAX_PATH
         Exclusive                     AS ASCIIZ * %MAX_PATH
         Characteristics               AS ASCIIZ * %MAX_PATH
         Address                       AS ASCIIZ * %MAX_PATH
         UiNumberDescFormat            AS ASCIIZ * %MAX_PATH
         MaximumProperty               AS ASCIIZ * %MAX_PATH
         RemovalPolicy                 AS ASCIIZ * %MAX_PATH
         RemovalPolicyDefault          AS ASCIIZ * %MAX_PATH
         RemovalPolicyOverride         AS ASCIIZ * %MAX_PATH
         InstallState                  AS ASCIIZ * %MAX_PATH
         LocationPaths                 AS ASCIIZ * %MAX_PATH
         PowerData                     AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE UsbVidPid                     'Type to hold USB Vid/Pid/Revision info
         VendorId                      AS ASCIIZ * %MAX_PATH
         ProductId                     AS ASCIIZ * %MAX_PATH
         Revision                      AS ASCIIZ * %MAX_PATH
    END TYPE
    '--------------------------------------------------------------------------------------------------
    
    '------------------------------------- DECLARES ---------------------------------------------------
    DECLARE FUNCTION GetDeviceList ALIAS "GetDeviceList"(BYREF hDeviceInfo AS DWORD)  AS DWORD
    DECLARE FUNCTION GetDeviceListSize ALIAS "GetDeviceListSize"(BYREF spdi AS SP_DEVINFO_DATA)  AS DWORD
    DECLARE FUNCTION GetDeviceClass ALIAS "GetDeviceClass"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceFriendlyName ALIAS "GetDeviceFriendlyName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceDesc ALIAS "GetDeviceDesc"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceHardwareId ALIAS "GetDeviceHardwareId"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceCompatibleId ALIAS "GetDeviceCompatibleId"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUnused0 ALIAS "GeDeviceUnused0"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceService ALIAS "GetDeviceService"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUnused1 ALIAS "GetDeviceUnused1"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUnused2 ALIAS "GetDeviceUnused2"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceClassGuid ALIAS "GetDeviceClassGuid"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceDriver ALIAS "GetDeviceDriver"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceConfigFlags ALIAS "GetDeviceConfigFlags"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceMfg ALIAS "GetDeviceMfg"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceLocation ALIAS "GetDeviceLocation"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceObjectName ALIAS "GetDeviceObjectName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceCapabilities ALIAS "GetDeviceCapabilities"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUiNumber ALIAS "GetDeviceUiNumber"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUpperFilters ALIAS "GetDeviceUpperFilters"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceLowerFilters ALIAS "GetDeviceLowerFilters"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceBusTypeGuid ALIAS "GetDeviceBusTypeGuid"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceLegacyBusType ALIAS "GetDeviceLegacyBusType"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceBusNumber ALIAS "GetDeviceBusNumber"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceEnumeratorName ALIAS "GetDeviceEnumeratorName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceSecurityBinary ALIAS "GetDeviceSecurityBinary"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceSecuritySelfDirectedSearch ALIAS "GetDeviceSecuritySelfDirectedSearch"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceType ALIAS "GetDeviceType"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceExclusive ALIAS "GetDeviceExclusive"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceCharacteristics ALIAS "GetDeviceCharacteristics"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceAddress ALIAS "GetDeviceAddress"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceUiNumberDescFormat ALIAS "GetDeviceUiNumberDescFormat"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceMaximumProperty ALIAS "GetDeviceMaximumProperty"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceRemovalPolicy ALIAS "GetDeviceRemovalPolicy"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceRemovalPolicyDefault ALIAS "GetDeviceRemovalPolicyDefault"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceRemovalPolicyOverride ALIAS "GetDeviceRemovalPolicyOverride"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceInstallState ALIAS "GetDeviceInstallState"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDeviceLocationPaths ALIAS "GetDeviceLocationPaths"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION GetDevicePowerData ALIAS "GetDevicePowerData"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) AS DWORD
    DECLARE FUNCTION DestroyDeviceList ALIAS "DestroyDeviceList"(BYREF hDeviceInfo AS DWORD)  AS DWORD
    
    DECLARE FUNCTION GetUsbDeviceType ALIAS "GetUsbDeviceType"(BYREF UsbDriver AS DeviceDriver, BYREF UsbDeviceType AS STRING) AS DWORD
    DECLARE FUNCTION GetUsbVid ALIAS "GetUsbVid"(BYREF UsbDriver AS DeviceDriver, BYREF UsbVid AS STRING) AS DWORD
    DECLARE FUNCTION GetUsbPid ALIAS "GetUsbPid"(BYREF UsbDriver AS DeviceDriver, BYREF UsbPid AS STRING) AS DWORD
    DECLARE FUNCTION GetUsbSubSys ALIAS "GetUsbSubSys"(BYREF UsbDriver AS DeviceDriver, BYREF UsbSubSys AS STRING) AS DWORD
    DECLARE FUNCTION GetUsbRev ALIAS "GetUsbRev"(BYREF UsbDriver AS DeviceDriver, BYREF UsbRev AS STRING) AS DWORD
    
    DECLARE FUNCTION ListUsbDrivers ALIAS "ListUsbDrivers"(BYREF InfoUsbDriver() AS DeviceDriver) AS LONG
    '--------------------------------------------------------------------------------------------------
    
    '------------------------------------- FUNCTIONS --------------------------------------------------
    FUNCTION GetDeviceList ALIAS "GetDeviceList"(BYREF hDeviceInfo AS DWORD) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         hDeviceInfo = SetupDiGetClassDevs(BYVAL %NULL, BYVAL %NULL, BYVAL %NULL, %DIGCF_ALLCLASSES)       ' Get a handle to the device list...
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceListSize ALIAS "GetDeviceListSize"(BYREF spdi AS SP_DEVINFO_DATA) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         spdi.cbSize = SIZEOF(spdi)
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceClass ALIAS "GetDeviceClass"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_CLASS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)
         UsbDriver.ClassName = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceFriendlyName ALIAS "GetDeviceFriendlyName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_FRIENDLYNAME, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)    ' Try and get friendly name...
         UsbDriver.FriendlyName = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceDesc ALIAS "GetDeviceDesc"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_DEVICEDESC, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.DeviceDesc = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceHardwareId ALIAS "GetDeviceHardwareId"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_HARDWAREID, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.HardwareId = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceCompatibleId ALIAS "GetDeviceCompatibleId"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_COMPATIBLEIDS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.CompatibleId = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUnused0 ALIAS "GeDeviceUnused0"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UNUSED0, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Unused0 = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceService ALIAS "GetDeviceService"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_SERVICE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Service = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUnused1 ALIAS "GetDeviceUnused1"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UNUSED1, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Unused1 = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUnused2 ALIAS "GetDeviceUnused2"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UNUSED2, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Unused2 = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceClassGuid ALIAS "GetDeviceClassGuid"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_CLASSGUID, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.ClassGuid = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceDriver ALIAS "GetDeviceDriver"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_DRIVER, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Driver = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceConfigFlags ALIAS "GetDeviceConfigFlags"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_CONFIGFLAGS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.ConfigFlags = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceMfg ALIAS "GetDeviceMfg"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_MFG, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Mfg = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceLocation ALIAS "GetDeviceLocation"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_LOCATION_INFORMATION, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Location = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceObjectName ALIAS "GetDeviceObjectName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_PHYSICAL_DEVICE_OBJECT_NAME, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.ObjectName = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceCapabilities ALIAS "GetDeviceCapabilities"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_CAPABILITIES, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Capabilities = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUiNumber ALIAS "GetDeviceUiNumber"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UI_NUMBER, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.UiNumber = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUpperFilters ALIAS "GetDeviceUpperFilters"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UPPERFILTERS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.UpperFilters = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceLowerFilters ALIAS "GetDeviceLowerFilters"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_LOWERFILTERS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.LowerFilters = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceBusTypeGuid ALIAS "GetDeviceBusTypeGuid"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_BUSTYPEGUID, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.BusTypeGuid = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceLegacyBusType ALIAS "GetDeviceLegacyBusType"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_LEGACYBUSTYPE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.LegacyBusType = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceBusNumber ALIAS "GetDeviceBusNumber"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_BUSNUMBER, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.BusNumber = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceEnumeratorName ALIAS "GetDeviceEnumeratorName"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_ENUMERATOR_NAME, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.EnumeratorName = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceSecurityBinary ALIAS "GetDeviceSecurityBinary"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_SECURITY, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.SecurityBinary = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceSecuritySelfDirectedSearch ALIAS "GetDeviceSecuritySelfDirectedSearch"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_SECURITY_SDS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.SecuritySelfDirectedSearch = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceType ALIAS "GetDeviceType"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_DEVTYPE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.DeviceType = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceExclusive ALIAS "GetDeviceExclusive"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_EXCLUSIVE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Exclusive = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceCharacteristics ALIAS "GetDeviceCharacteristics"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_CHARACTERISTICS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Characteristics = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceAddress ALIAS "GetDeviceAddress"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_ADDRESS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.Address = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceUiNumberDescFormat ALIAS "GetDeviceUiNumberDescFormat"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_UI_NUMBER_DESC_FORMAT, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.UiNumberDescFormat = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceMaximumProperty ALIAS "GetDeviceMaximumProperty"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_MAXIMUM_PROPERTY, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.MaximumProperty = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceRemovalPolicy ALIAS "GetDeviceRemovalPolicy"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_REMOVAL_POLICY, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.RemovalPolicy = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceRemovalPolicyDefault ALIAS "GetDeviceRemovalPolicyDefault"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_REMOVAL_POLICY_HW_DEFAULT, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.RemovalPolicyDefault = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceRemovalPolicyOverride ALIAS "GetDeviceRemovalPolicyOverride"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_REMOVAL_POLICY_OVERRIDE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.RemovalPolicyOverride = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceInstallState ALIAS "GetDeviceInstallState"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_INSTALL_STATE, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.InstallState = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDeviceLocationPaths ALIAS "GetDeviceLocationPaths"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_LOCATION_PATHS, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.LocationPaths = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetDevicePowerData ALIAS "GetDevicePowerData"(BYREF hDeviceInfo AS DWORD, BYREF spdi AS SP_DEVINFO_DATA, UsbDriver AS DeviceDriver)  EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL zText AS ASCIIZ * %MAX_PATH
         SetupDiGetDeviceRegistryProperty(hDeviceInfo, spdi, %SPDRP_DEVICE_POWER_DATA, BYVAL %NULL, zText, SIZEOF(zText), BYVAL %NULL)      ' Just get description...
         UsbDriver.PowerData = zText
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    
    FUNCTION DestroyDeviceList ALIAS "DestroyDeviceList"(BYREF hDeviceInfo AS DWORD) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         SetupDiDestroyDeviceInfoList(hDeviceInfo)        ' Tidy up...
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetUsbDeviceType ALIAS "GetUsbDeviceType"(BYREF UsbDriver AS DeviceDriver, BYREF UsbDeviceType AS STRING) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         UsbDeviceType = UCASE$(UsbDriver.HardwareId)                'Get the Hardware Id
    '*** PCI
         IF INSTR(UsbDeviceType, "PCI\") THEN                        'If PCI device then get the type and exit function
              IF INSTR(UsbDeviceType, "VEN_") THEN
                   UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "PCI\"), INSTR(UsbDeviceType, "VEN_") - 1)
              END IF
              IF INSTR(UsbDeviceType, "DEV_") THEN
                   UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "PCI\"), INSTR(UsbDeviceType, "DEV_") - 1)
              END IF
              REPLACE "\" WITH "" IN UsbDeviceType
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB ROOT HUB
         IF INSTR(UsbDeviceType, "USB\ROOT_HUB&") THEN               'If Root Hub device then get the type and exit function
              IF INSTR(UsbDeviceType, "VID") THEN
                   UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "USB\ROOT_HUB&"), INSTR(UsbDeviceType, "VID") - 1)
              END IF
              REPLACE "&" WITH "" IN UsbDeviceType
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** ALSO USB ROOT HUB
         IF INSTR(UsbDeviceType, "USB\ROOT_HUB") THEN                'If Root Hub device then get the type and exit function
              IF INSTR(UsbDeviceType, "VID") THEN
                   UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "USB\ROOT_HUB"), INSTR(UsbDeviceType, "VID") - 1)
              END IF
              REPLACE "&" WITH "" IN UsbDeviceType
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB UNKNOWN DEVICE
         IF INSTR(UsbDeviceType, "USB\UNKNOWN") THEN                 'If Unknown device then get the type and exit function
              UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "USB\"), INSTR(UsbDeviceType, "UNKNOWN") - 1)
              REPLACE "\" WITH "" IN UsbDeviceType
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB DEVICES
         IF INSTR(UsbDeviceType, "USB\") THEN                        'If USB device then get the type and exit function
              IF INSTR(UsbDeviceType, "VID_") THEN
                   UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "USB\"), INSTR(UsbDeviceType, "VID_") - 1)
                   REPLACE "\" WITH "" IN UsbDeviceType
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB PRINTERS
         IF INSTR(UsbDeviceType, "USBPRINT\") THEN                   'If USB Printer device then get the type and exit function
              UsbDeviceType = MID$(UsbDeviceType, INSTR(UsbDeviceType, "USBPRINT\"), INSTR(UsbDeviceType, "USBPRINT\") + LEN("USBPRINT\") - 1)
              REPLACE "\" WITH "" IN UsbDeviceType
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
         UsbDeviceType = ""                                          'If some other device then get the type and exit function
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetUsbVid ALIAS "GetUsbVid"(BYREF UsbDriver AS DeviceDriver, BYREF UsbVid AS STRING) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL StartPoint AS LONG
         UsbVid = UCASE$(UsbDriver.HardwareId)
    '*** PCI
         IF INSTR(UsbVid, "PCI\") THEN                               'Get PCI VID
              IF INSTR(UsbVid, "VEN_") THEN
                   StartPoint = INSTR(UsbVid, "VEN_")
                   UsbVid = MID$(UsbVid, INSTR(UsbVid, "VEN_"), INSTR(StartPoint, UsbVid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "VEN_" WITH "" IN UsbVid
                   REPLACE "&" WITH "" IN UsbVid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB ROOT HUB
         IF INSTR(UsbVid, "USB\ROOT_HUB&") THEN                      'Get Root Hub VID
              IF INSTR(UsbVid, "VID") THEN
                   StartPoint = INSTR(UsbVid, "VID")
                   UsbVid = MID$(UsbVid, INSTR(UsbVid, "VID"), INSTR(StartPoint, UsbVid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "VID" WITH "" IN UsbVid
                   REPLACE "&" WITH "" IN UsbVid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** ALSO USB ROOT HUB
         IF INSTR(UsbVid, "USB\ROOT_HUB") THEN                       'Get Root Hub VID
              IF INSTR(UsbVid, "VID") THEN
                   StartPoint = INSTR(UsbVid, "VID")
                   UsbVid = MID$(UsbVid, INSTR(UsbVid, "VID"), INSTR(StartPoint, UsbVid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "VID" WITH "" IN UsbVid
                   REPLACE "&" WITH "" IN UsbVid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB UNKNOWN DEVICE
         IF INSTR(UsbVid, "USB\UNKNOWN") THEN                        'Get UNKNOWN VID
              UsbVid = MID$(UsbVid, INSTR(UsbVid, "USB\") + LEN("USB\"))
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB DEVICES
         IF INSTR(UsbVid, "USB\") THEN                               'Get USB VID
              IF INSTR(UsbVid, "VID_") THEN
                   StartPoint = INSTR(UsbVid, "VID_")
                   UsbVid = MID$(UsbVid, INSTR(UsbVid, "VID_"), INSTR(StartPoint, UsbVid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "VID_" WITH "" IN UsbVid
                   REPLACE "&" WITH "" IN UsbVid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
    '*** USB PRINTERS
         IF INSTR(UsbVid, "USBPRINT\") THEN                          'Get USB Printer VID
              UsbVid = MID$(UsbVid, INSTR(UsbVid, "USBPRINT\") + LEN("USBPRINT\"))
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct value returned
         END IF
         UsbVid = ""
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetUsbPid ALIAS "GetUsbPid"(BYREF UsbDriver AS DeviceDriver, BYREF UsbPid AS STRING) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL StartPoint AS LONG
         UsbPid = UCASE$(UsbDriver.HardwareId)
    '*** PCI
         IF INSTR(UsbPid, "PCI\") THEN                               'Get PCI PID
              IF INSTR(UsbPid, "DEV_") THEN
                   StartPoint = INSTR(UsbPid, "DEV_")
                   UsbPid = MID$(UsbPid, INSTR(UsbPid, "DEV_"), INSTR(StartPoint, UsbPid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "DEV_" WITH "" IN UsbPid
                   REPLACE "&" WITH "" IN UsbPid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB ROOT HUB
         IF INSTR(UsbPid, "USB\ROOT_HUB&") THEN                      'Get Root Hub PID
              IF INSTR(UsbPid, "PID") THEN
                   StartPoint = INSTR(UsbPid, "PID")
                   UsbPid = MID$(UsbPid, INSTR(UsbPid, "PID"), INSTR(StartPoint, UsbPid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "PID" WITH "" IN UsbPid
                   REPLACE "&" WITH "" IN UsbPid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** ALSO USB ROOT HUB
         IF INSTR(UsbPid, "USB\ROOT_HUB") THEN                       'Get Root Hub PID
              IF INSTR(UsbPid, "PID") THEN
                   StartPoint = INSTR(UsbPid, "PID")
                   UsbPid = MID$(UsbPid, INSTR(UsbPid, "PID"), INSTR(StartPoint, UsbPid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "PID" WITH "" IN UsbPid
                   REPLACE "&" WITH "" IN UsbPid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB UNKNOWN DEVICE
         IF INSTR(UsbPid, "USB\UNKNOWN") THEN                        'Set USB Unknown PID = ""
              UsbPid = ""
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB DEVICES
         IF INSTR(UsbPid, "USB\") THEN                               'Get USB PID
    '          UsbPid = MID$(UsbPid, INSTR(UsbPid, "USB\") + LEN("USB\"))
              IF INSTR(UsbPid, "PID_") THEN
                   StartPoint = INSTR(UsbPid, "PID_")
                   UsbPid = MID$(UsbPid, INSTR(UsbPid, "PID_"), INSTR(StartPoint, UsbPid, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "PID_" WITH "" IN UsbPid
                   REPLACE "&" WITH "" IN UsbPid
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB PRINTERS
         IF INSTR(UsbPid, "USBPRINT\") THEN                          'Get USB Printer PID
              StartPoint = INSTR(UsbPid, "USBPRINT\HEWLETT-PACKARD")+ LEN("USBPRINT\HEWLETT-PACKARD")
              UsbPid = MID$(UsbPid, StartPoint)
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
         UsbPid = ""                                                 'If unknown PID then return ""
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct Palue returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetUsbSubSys ALIAS "GetUsbSubSys"(BYREF UsbDriver AS DeviceDriver, BYREF UsbSubSys AS STRING) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL StartPoint AS LONG
         UsbSubSys = UCASE$(UsbDriver.HardwareId)
    '*** PCI
         IF INSTR(UsbSubSys, "PCI\") THEN                            'If PCI Device return SubSystem ID
              IF INSTR(UsbSubSys, "SUBSYS_") THEN
                   StartPoint = INSTR(UsbSubSys, "SUBSYS_")
                   UsbSubSys = MID$(UsbSubSys, INSTR(UsbSubSys, "SUBSYS_"), INSTR(StartPoint, UsbSubSys, "&") + LEN("&") - StartPoint - 1)
                   REPLACE "SUBSYS_" WITH "" IN UsbSubSys
                   REPLACE "&" WITH "" IN UsbSubSys
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
         UsbSubSys = ""
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct Palue returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION GetUsbRev ALIAS "GetUsbRev"(BYREF UsbDriver AS DeviceDriver, BYREF UsbRev AS STRING) EXPORT AS DWORD
         ON ERROR GOTO ErrHandler
         LOCAL StartPoint AS LONG
         UsbRev = UCASE$(UsbDriver.HardwareId)
    '*** PCI
         IF INSTR(UsbRev, "PCI\") THEN                               'Get PCI Revision
              IF INSTR(UsbRev, "REV_") THEN
                   StartPoint = INSTR(UsbRev, "REV_")
                   UsbRev = MID$(UsbRev, INSTR(UsbRev, "REV_"))
                   REPLACE "REV_" WITH "" IN UsbRev
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB ROOT HUB
         IF INSTR(UsbRev, "USB\ROOT_HUB&") THEN                      'Get USB Root Hub Revision
              IF INSTR(UsbRev, "REV") THEN
                   StartPoint = INSTR(UsbRev, "REV")
                   UsbRev = MID$(UsbRev, INSTR(UsbRev, "REV"))
                   REPLACE "REV" WITH "" IN UsbRev
                   REPLACE "&" WITH "" IN UsbRev
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** ALSO USB ROOT HUB
         IF INSTR(UsbRev, "USB\ROOT_HUB") THEN                       'Get USB Root Hub Revision
    '          UsbRev = MID$(UsbRev, INSTR(UsbRev, "USB\ROOT_HUB") + LEN("USB\ROOT_HUB"))
              IF INSTR(UsbRev, "REV") THEN
                   StartPoint = INSTR(UsbRev, "REV")
                   UsbRev = MID$(UsbRev, INSTR(UsbRev, "REV"))
                   REPLACE "REV" WITH "" IN UsbRev
                   REPLACE "&" WITH "" IN UsbRev
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB UNKNOWN DEVICE
         IF INSTR(UsbRev, "USB\UNKNOWN") THEN                        'If USB Unknown return ""
              UsbRev = ""
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB DEVICES
         IF INSTR(UsbRev, "USB\") THEN                               'Get USB Revision
              IF INSTR(UsbRev, "REV_") THEN
                   StartPoint = INSTR(UsbRev, "REV_")
                   UsbRev = MID$(UsbRev, INSTR(UsbRev, "REV_"))
                   REPLACE "REV_" WITH "" IN UsbRev
                   REPLACE "&" WITH "" IN UsbRev
              END IF
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
    '*** USB PRINTERS
         IF INSTR(UsbRev, "USBPRINT\") THEN                          'If USB Printer return "" for revision
              UsbRev = ""
              FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
              EXIT FUNCTION                 'Exit function so correct Palue returned
         END IF
         UsbRev = ""
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct Palue returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    
    FUNCTION ListUsbDrivers ALIAS "ListUsbDrivers"(BYREF InfoUsbDriver() AS DeviceDriver) EXPORT AS LONG
         ON ERROR GOTO ErrHandler
         LOCAL i AS LONG
         LOCAL j AS LONG
         LOCAL hDeviceInfo AS DWORD
         LOCAL spdi AS SP_DEVINFO_DATA
         LOCAL Success AS LONG
    ' Enumerate devices using SETUPAPI.DLL...
         Success = GetDeviceList(hDeviceInfo)         'Get the list
         Success = GetDeviceListSize(spdi)            'Get the size of the list
         DO UNTIL SetupDiEnumDeviceInfo(hDeviceInfo, i, spdi) = 0    'Enumerate all devices
              REDIM PRESERVE InfoUsbDriver(j)         'Redim the array
              Success = GetDeviceClass(hDeviceInfo, spdi, InfoUsbDriver(j))
              SELECT CASE UCASE$(InfoUsbDriver(j).ClassName)
    '*** Uncomment any of the lines below if wanting that information
                   CASE "USB"
                        Success = GetDeviceFriendlyName(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceDesc(hDeviceInfo, spdi, InfoUsbDriver(j))
                        Success = GetDeviceHardwareId(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceCompatibleId(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUnUsed0(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceService(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUnUsed1(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUnUsed2(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceClassGuid(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceDriver(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceConfigFlags(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceMfg(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceLocation(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceObjectName(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceCapabilities(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUiNumber(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUpperFilters(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceLowerFilters(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceBusTypeGuid(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceLegacyBusType(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceBusNumber(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceEnumeratorName(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceSecurityBinary(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceSecuritySelfDirectedSearch(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceType(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceExclusive(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceCharacteristics(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceAddress(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceUiNumberDescFormat(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceMaximumProperty(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceRemovalPolicy(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceRemovalPolicyDefault(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceRemovalPolicyOverRide(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceInstallState(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDeviceLocationPaths(hDeviceInfo, spdi, InfoUsbDriver(j))
    '                    Success = GetDevicePowerData(hDeviceInfo, spdi, InfoUsbDriver(j))
                        REDIM PRESERVE InfoUsbDriver(UBOUND(InfoUsbDriver) + 1)     'Get ready for next device
                   CASE ELSE
                        ARRAY DELETE InfoUsbDriver(j)                               'If not a needed device, delete the element
              END SELECT
              INCR i                                                                'Increment device
              j = UBOUND(InfoUsbDriver)                                             'Get array count
         LOOP
         DestroyDeviceList(hDeviceInfo)                                             'Free Device List info
         REDIM PRESERVE InfoUsbDriver(UBOUND(InfoUsbDriver) - 1)                    'Free Last element (Should be blank)
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    SetupApi.inc from Kev Peel
    Code:
    '  SETUPAPI.DLL is available on Win95/NT4 SP3 and later versions.
    '  Define %UNICODE to enable unicode support (default is ANSI).
    '  Define %SETUPAPI_VER to predefine the DLL version, (default is Win98 or IE4).
    '
    
    #IF NOT %DEF(%WINAPI)
        #INCLUDE "win32api.inc"
    #ENDIF
    
    
    #IF NOT %DEF(%SETUPAPI)
    
    %SETUPAPI = 1
    
    
    '  determine version of setupapi based on _WIN32_WINDOWS and _WIN32_WINNT
    
    '  NT4 version of setupapi (&H0400) is earliest, and installed onto Win95 by IE.
    '  Win2k version of setupapi (&H0500) also shipped in WinME
    '  we'll use "&H0410" to indicate version of setupapi shipped with Win98
    
    #IF NOT %DEF(%SETUPAPI_VER)
    '    %SETUPAPI_VER = &H0410
        %SETUPAPI_VER = &H0400      'Go with earliest version to cover all
    #ENDIF
    
    '
    ' Define maximum string length constants
    '
    %LINE_LEN                     = 256     ' Windows 9x-compatible maximum for
                                            ' displayable strings coming from a
                                            ' device INF.
    %MAX_INF_STRING_LENGTH        = 4096    ' Actual maximum size of an INF string
                                            ' (including string substitutions).
    %MAX_INF_SECTION_NAME_LENGTH  = 255     ' For Windows 9x compatibility, INF
                                            ' section names should be constrained
                                            ' to 32 characters.
    
    %MAX_TITLE_LEN                = 60
    %MAX_INSTRUCTION_LEN          = 256
    %MAX_LABEL_LEN                = 30
    %MAX_SERVICE_NAME_LEN         = 256
    %MAX_SUBTITLE_LEN             = 256
    
    
    '  Define maximum length of a machine name in the format expected by ConfigMgr32
    '  CM_Connect_Machine (i.e., "\\\\MachineName\0").
    
    %SP_MAX_MACHINENAME_LENGTH   = (%MAX_PATH + 3)
    
    
    '  Define type for reference to loaded inf file
    MACRO HINF = DWORD
    
    
    '  Inf context structure. Applications must not interpret or
    '  overwrite values in these structures.
    
    TYPE INFCONTEXT
         Inf AS DWORD
         CurrentInf AS DWORD
         Section AS DWORD
         dwLine AS DWORD
    END TYPE
    
    
    '  Inf file information structure.
    
    TYPE SP_INF_INFORMATION
         InfStyle AS DWORD
         InfCount AS DWORD
         VersionData AS BYTE PTR     ' Array of byte values follow.
    END TYPE
    
    
    
    ' Define structure for passing alternate platform info into
    ' SetupSetFileQueueAlternatePlatform and SetupQueryInfOriginalFileInformation.
    
    TYPE SP_ALTPLATFORM_INFO_V2
    
         Platform AS DWORD
    
    '  major and minor version numbers to use
    
         MajorVersion AS DWORD
         MinorVersion AS DWORD
    
    '  processor architecture to use (PROCESSOR_ARCHITECTURE_INTEL,
    '  PROCESSOR_ARCHITECTURE_AMD64, or PROCESSOR_ARCHITECTURE_IA64.
    
         ProcessorArchitecture AS WORD
         Reserved AS WORD                      '  for compatibility with V1 structure
         Flags AS WORD                         '  indicates validity of non V1 fields
    
    '  specify SP_ALTPLATFORM_FLAGS_VERSION_RANGE in Flags
    '  to use FirstValidatedMajorVersion and FirstValidatedMinorVersion
    
    '  Major and minor versions of the oldest previous OS for which this
    '  package's digital signature may be considered valid.  For example, say
    '  the alternate platform is VER_PLATFORM_WIN32_NT, version 5.1.  However,
    '  it is wished that driver packages signed with a 5.0 osattr also be
    '  considered valid.  In this case, you'd have a  MajorVersion/MinorVersion
    '  of 5.1, and a FirstValidatedMajorVersion/FirstValidatedMinorVersion of
    '  5.0.  To validate packages signed for any previous OS release, specify
    '  0 for these fields.  To only validate against the target alternate
    '  platform, specify the same values as those in the MajorVersion and
    '  MinorVersion fields.
    
         FirstValidatedMajorVersion AS DWORD
         FirstValidatedMinorVersion AS DWORD
    
    END TYPE
    
    
    TYPE SP_ALTPLATFORM_INFO_V1
         cbSize AS DWORD
                                               '
                                               '  platform to use (VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT)
                                               '
         Platform AS DWORD
                                               '
                                               '  major and minor version numbers to use
                                               '
         MajorVersion AS DWORD
         MinorVersion AS DWORD
                                               '
                                               '  processor architecture to use (PROCESSOR_ARCHITECTURE_INTEL,
                                               '  PROCESSOR_ARCHITECTURE_AMD64, or PROCESSOR_ARCHITECTURE_IA64.
                                               '
         ProcessorArchitecture AS WORD
         Reserved AS WORD                      '  must be zero.
    END TYPE
    
    
    #IF %DEF(%USE_SP_ALTPLATFORM_INFO_V1) AND (%SETUPAPI_VER < &H0501) '  use version 1 altplatform info data structure
    
        MACRO SP_ALTPLATFORM_INFO  = SP_ALTPLATFORM_INFO_V1
        MACRO PSP_ALTPLATFORM_INFO = PSP_ALTPLATFORM_INFO_V1
    
    #ELSE                          ' use version 2 altplatform info data structure
    
        MACRO SP_ALTPLATFORM_INFO  = SP_ALTPLATFORM_INFO_V2
        MACRO PSP_ALTPLATFORM_INFO = PSP_ALTPLATFORM_INFO_V2
    
        '  the following flags are available to SP_ALTPLATFORM_INFO_V2
        %SP_ALTPLATFORM_FLAGS_VERSION_RANGE = (&H0001)     ' FirstValidatedMajor/MinorVersion
    
    #ENDIF  ' use current version of altplatform info data structure
    
    
    
    '  Define structure that is filled in by SetupQueryInfOriginalFileInformation
    '  to indicate the INF's original name and the original name of the (potentially
    '  platform-specific) catalog file specified by that INF.
    
    TYPE SP_ORIGINAL_FILE_INFO_A
         cbSize AS DWORD
         OriginalInfName AS ASCIIZ * %MAX_PATH
         OriginalCatalogName AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE SP_ORIGINAL_FILE_INFO_W
         cbSize AS DWORD
         OriginalInfName AS STRING * %MAX_PATH * 2
         OriginalCatalogName AS STRING * %MAX_PATH * 2
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_ORIGINAL_FILE_INFO  = SP_ORIGINAL_FILE_INFO_W
    #ELSE
        MACRO SP_ORIGINAL_FILE_INFO  = SP_ORIGINAL_FILE_INFO_A
    #ENDIF
    
    
    '  SP_INF_INFORMATION.InfStyle values
    
    %INF_STYLE_NONE           = &H00000000       '  unrecognized or non-existent
    %INF_STYLE_OLDNT          = &H00000001       '  winnt 3.x
    %INF_STYLE_WIN4           = &H00000002       '  Win95
    
    
    '  Additional InfStyle flags that may be specified when calling SetupOpenInfFile.
    
    %INF_STYLE_CACHE_ENABLE   = &H00000010 '  always cache INF, even outside of %windir%\Inf
    %INF_STYLE_CACHE_DISABLE  = &H00000020 '  delete cached INF information
    #IF (%SETUPAPI_VER >= &H0502)
        %INF_STYLE_CACHE_IGNORE   = &H00000040 '  ignore any cached INF information
    #ENDIF
    
    
    '
    '  Target directory specs.
    '
    %DIRID_ABSOLUTE          = -1             '  real 32-bit -1
    %DIRID_ABSOLUTE_16BIT    = &Hffff         '  16-bit -1 for compat w/setupx
    %DIRID_NULL              = 0
    %DIRID_SRCPATH           = 1
    %DIRID_WINDOWS           = 10
    %DIRID_SYSTEM            = 11              '  system32
    %DIRID_DRIVERS           = 12
    %DIRID_IOSUBSYS          = %DIRID_DRIVERS
    %DIRID_INF               = 17
    %DIRID_HELP              = 18
    %DIRID_FONTS             = 20
    %DIRID_VIEWERS           = 21
    %DIRID_COLOR             = 23
    %DIRID_APPS              = 24
    %DIRID_SHARED            = 25
    %DIRID_BOOT              = 30
    
    %DIRID_SYSTEM16          = 50
    %DIRID_SPOOL             = 51
    %DIRID_SPOOLDRIVERS      = 52
    %DIRID_USERPROFILE       = 53
    %DIRID_LOADER            = 54
    %DIRID_PRINTPROCESSOR    = 55
    
    %DIRID_DEFAULT           = %DIRID_SYSTEM
    
    '
    '  The following DIRIDs are for commonly-used shell "special folders".  The
    '  complete list of such folders is contained in shlobj.h.  In that headerfile,
    '  each folder is assigned a CSIDL_* value.  The DIRID values below are created
    '  by taking the CSIDL value in shlobj.h and OR'ing it with &H4000.  Thus, if
    '  an INF needs to reference other special folders not defined below, it may
    '  generate one using the above mechanism, and setupapi will automatically deal
    '  with it and use the corresponding shell's path where appropriate.  (Remember
    '  that DIRIDs must be specified in decimal, not hex, in an INF when used for
    '  string substitution.)
    '
    
    %DIRID_COMMON_STARTMENU        = 16406  '  All Users\Start Menu
    %DIRID_COMMON_PROGRAMS         = 16407  '  All Users\Start Menu\Programs
    %DIRID_COMMON_STARTUP          = 16408  '  All Users\Start Menu\Programs\Startup
    %DIRID_COMMON_DESKTOPDIRECTORY = 16409  '  All Users\Desktop
    %DIRID_COMMON_FAVORITES        = 16415  '  All Users\Favorites
    %DIRID_COMMON_APPDATA          = 16419  '  All Users\Application Data
    
    %DIRID_PROGRAM_FILES           = 16422  '  Program Files
    %DIRID_SYSTEM_X86              = 16425  '  system32 on RISC
    %DIRID_PROGRAM_FILES_X86       = 16426  '  Program Files on RISC
    %DIRID_PROGRAM_FILES_COMMON    = 16427  '  Program Files\Common
    %DIRID_PROGRAM_FILES_COMMONX86  =16428  '  x86 Program Files\Common on RISC
    
    %DIRID_COMMON_TEMPLATES        = 16429  '  All Users\Templates
    %DIRID_COMMON_DOCUMENTS        = 16430  '  All Users\Documents
    
    
    
    '  First user-definable dirid. See SetupSetDirectoryId().
    
    %DIRID_USER              = &H8000
    
    
    
    '  Setup callback notification routine type
    
    DECLARE FUNCTION PSP_FILE_CALLBACK(BYVAL dwContext AS DWORD, BYVAL dwNotification AS DWORD, BYVAL dwParam1 AS DWORD, BYVAL dwParam2 AS DWORD) AS DWORD
    
    
    '  Operation/queue start/end notification. These are ordinal values.
    
    %SPFILENOTIFY_STARTQUEUE         = &H00000001
    %SPFILENOTIFY_ENDQUEUE           = &H00000002
    %SPFILENOTIFY_STARTSUBQUEUE      = &H00000003
    %SPFILENOTIFY_ENDSUBQUEUE        = &H00000004
    %SPFILENOTIFY_STARTDELETE        = &H00000005
    %SPFILENOTIFY_ENDDELETE          = &H00000006
    %SPFILENOTIFY_DELETEERROR        = &H00000007
    %SPFILENOTIFY_STARTRENAME        = &H00000008
    %SPFILENOTIFY_ENDRENAME          = &H00000009
    %SPFILENOTIFY_RENAMEERROR        = &H0000000a
    %SPFILENOTIFY_STARTCOPY          = &H0000000b
    %SPFILENOTIFY_ENDCOPY            = &H0000000c
    %SPFILENOTIFY_COPYERROR          = &H0000000d
    %SPFILENOTIFY_NEEDMEDIA          = &H0000000e
    %SPFILENOTIFY_QUEUESCAN          = &H0000000f
    
    '  These are used with SetupIterateCabinet().
    
    %SPFILENOTIFY_CABINETINFO        = &H00000010
    %SPFILENOTIFY_FILEINCABINET      = &H00000011
    %SPFILENOTIFY_NEEDNEWCABINET     = &H00000012
    %SPFILENOTIFY_FILEEXTRACTED      = &H00000013
    %SPFILENOTIFY_FILEOPDELAYED      = &H00000014
    
    '  These are used for backup operations
    
    %SPFILENOTIFY_STARTBACKUP        = &H00000015
    %SPFILENOTIFY_BACKUPERROR        = &H00000016
    %SPFILENOTIFY_ENDBACKUP          = &H00000017
    
    '  Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACKEX)
    
    %SPFILENOTIFY_QUEUESCAN_EX       = &H00000018
    
    %SPFILENOTIFY_STARTREGISTRATION  = &H00000019
    %SPFILENOTIFY_ENDREGISTRATION    = &H00000020
    
    #IF (%SETUPAPI_VER >= &H0501)
    
    '  Extended notification for SetupScanFileQueue(Flags=SPQ_SCAN_USE_CALLBACK_SIGNERINFO)
    %SPFILENOTIFY_QUEUESCAN_SIGNERINFO = &H00000040
    
    #ENDIF
    
    
    '  Copy notification. These are bit flags that may be combined.
    
    %SPFILENOTIFY_LANGMISMATCH       = &H00010000
    %SPFILENOTIFY_TARGETEXISTS       = &H00020000
    %SPFILENOTIFY_TARGETNEWER        = &H00040000
    
    
    '  File operation codes and callback outcomes.
    
    %FILEOP_COPY                     = 0
    %FILEOP_RENAME                   = 1
    %FILEOP_DELETE                   = 2
    %FILEOP_BACKUP                   = 3
    
    %FILEOP_ABORT                    = 0
    %FILEOP_DOIT                     = 1
    %FILEOP_SKIP                     = 2
    %FILEOP_RETRY                    = %FILEOP_DOIT
    %FILEOP_NEWPATH                  = 4
    
    
    '  Flags in inf copy sections
    
    %COPYFLG_WARN_IF_SKIP            = &H00000001  '  warn if user tries to skip file
    %COPYFLG_NOSKIP                  = &H00000002  '  disallow skipping this file
    %COPYFLG_NOVERSIONCHECK          = &H00000004  '  ignore versions and overwrite target
    %COPYFLG_FORCE_FILE_IN_USE       = &H00000008  '  force file-in-use behavior
    %COPYFLG_NO_OVERWRITE            = &H00000010  '  do not copy if file exists on target
    %COPYFLG_NO_VERSION_DIALOG       = &H00000020  '  do not copy if target is newer
    %COPYFLG_OVERWRITE_OLDER_ONLY    = &H00000040  '  leave target alone if version same as source
    %COPYFLG_REPLACEONLY             = &H00000400  '  copy only if file exists on target
    %COPYFLG_NODECOMP                = &H00000800  '  don't attempt to decompress file; copy as-is
    %COPYFLG_REPLACE_BOOT_FILE       = &H00001000  '  file must be present upon reboot (i.e., it's
                                                   '  needed by the loader); this flag implies a reboot
    %COPYFLG_NOPRUNE                 = &H00002000  '  never prune this file
    
    
    '  Flags in inf delete sections
    '  New flags go in high word
    
    %DELFLG_IN_USE                   = &H00000001  '  queue in-use file for delete
    %DELFLG_IN_USE1                  = &H00010000  '  high-word version of DELFLG_IN_USE
    
    
    '  Source and file paths. Used when notifying queue callback
    '  of SPFILENOTIFY_STARTxxx, SPFILENOTIFY_ENDxxx, and SPFILENOTIFY_xxxERROR.
    
    TYPE FILEPATHS
         Target AS DWORD                       '  ANSI or UNICODE Strings
         Source AS DWORD                       '  not used for delete operations
         Win32Error AS DWORD
         Flags AS DWORD                        '  such as SP_COPY_NOSKIP for copy errors
    END TYPE
    
    
    #IF %SETUPAPI_VER >= &H0501
    
    TYPE FILEPATHS_SIGNERINFO
         Target AS DWORD                       '  ANSI or UNICODE Strings
         Source AS DWORD                       '  not used for delete operations
         Win32Error AS DWORD
         Flags AS DWORD                        '  such as SP_COPY_NOSKIP for copy errors
         DigitalSigner AS DWORD
         Version AS DWORD
         CatalogFile AS DWORD
    END TYPE
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    '
    '  Structure used with SPFILENOTIFY_NEEDMEDIA
    '
    TYPE SOURCE_MEDIA
         Reserved AS DWORD                     '  ANSI or UNICODE Strings
         Tagfile AS DWORD                      '  may be NULL
         Description AS DWORD
    
        '  Pathname part and filename part of source file
        '  that caused us to need the media.
    
         SourcePath AS DWORD                   '  ANSI or UNICODE Strings
         SourceFile AS DWORD                   '  ANSI or UNICODE Strings
         Flags AS DWORD                        '  subset of SP_COPY_xxx
    END TYPE
    
    '  Structure used with SPFILENOTIFY_CABINETINFO and
    '  SPFILENOTIFY_NEEDNEWCABINET
    
    TYPE CABINET_INFO
         CabinetPath AS DWORD                  '  ANSI or UNICODE Strings
         CabinetFile AS DWORD                  '  ANSI or UNICODE Strings
         DiskName AS DWORD
         SetId AS WORD
         CabinetNumber AS WORD
    END TYPE
    
    '
    '  Structure used with SPFILENOTIFY_FILEINCABINET
    '
    TYPE FILE_IN_CABINET_INFO
         NameInCabinet AS DWORD                '  ANSI or UNICODE Strings
         FileSize AS DWORD
         Win32Error AS DWORD
         DosDate AS WORD
         DosTime AS WORD
         DosAttribs AS WORD
         FullTargetName AS ASCIIZ * %MAX_PATH
    END TYPE
    
    
    '  Structure used for SPFILENOTIFY_REGISTRATION
    '  callback
    
    TYPE SP_REGISTER_CONTROL_STATUS
         cbSize AS DWORD
         FileName AS DWORD                     '  ANSI or UNICODE Strings
         Win32Error AS DWORD
         FailureCode AS DWORD
    END TYPE
    
    
    '  valid values for SP_REGISTER_CONTROL_STATUS.FailureCode field
    
    
    %SPREG_SUCCESS      = &H00000000
    %SPREG_LOADLIBRARY  = &H00000001
    %SPREG_GETPROCADDR  = &H00000002
    %SPREG_REGSVR       = &H00000003
    %SPREG_DLLINSTALL   = &H00000004
    %SPREG_TIMEOUT      = &H00000005
    %SPREG_UNKNOWN      = &HFFFFFFFF
    
    
    '  Define type for setup file queue
    
    MACRO HSPFILEQ = DWORD
    
    
    '  Structure used with SetupQueueCopyIndirect
    
    TYPE SP_FILE_COPY_PARAMS_A
         cbSize AS DWORD
         QueueHandle AS HSPFILEQ
         SourceRootPath AS DWORD               '  ANSI Strings
         SourcePath AS DWORD                   '  ANSI Strings
         SourceFilename AS DWORD               '  ANSI Strings
         SourceDescription AS DWORD            '  ANSI Strings
         SourceTagfile AS DWORD                '  ANSI Strings
         TargetDirectory AS DWORD              '  ANSI Strings
         TargetFilename AS DWORD               '  ANSI Strings
         CopyStyle AS DWORD
         LayoutInf AS HINF
         SecurityDescriptor AS DWORD           '  ANSI Strings
    END TYPE
    
    TYPE SP_FILE_COPY_PARAMS_W
         cbSize AS DWORD
         QueueHandle AS HSPFILEQ
         SourceRootPath AS DWORD               '  UNICODE Strings
         SourcePath AS DWORD                   '  UNICODE Strings
         SourceFilename AS DWORD               '  UNICODE Strings
         SourceDescription AS DWORD            '  UNICODE Strings
         SourceTagfile AS DWORD                '  UNICODE Strings
         TargetDirectory AS DWORD              '  UNICODE Strings
         TargetFilename AS DWORD               '  UNICODE Strings
         CopyStyle AS DWORD
         LayoutInf AS HINF
         SecurityDescriptor AS DWORD           '  UNICODE Strings
    END TYPE
    
    
    '  Define type for setup disk space list
    
    MACRO HDSKSPC = DWORD
    
    
    
    '  Define type for reference to device information set
    
    MACRO HDEVINFO = DWORD
    
    
    TYPE SP_DEVINFO_DATA
         cbSize AS DWORD
         ClassGuid AS GUID
         DevInst AS DWORD                      '  DEVINST handle
         Reserved AS DWORD
    END TYPE
    
    
    '  Device interface information structure (references a device
    '  interface that is associated with the device information
    '  element that owns it).
    
    TYPE SP_DEVICE_INTERFACE_DATA
         cbSize AS DWORD
         InterfaceClassGuid AS GUID
         Flags AS DWORD
         Reserved AS DWORD
    END TYPE
    
    
    '  Flags for SP_DEVICE_INTERFACE_DATA.Flags field.
    
    %SPINT_ACTIVE  = &H00000001
    %SPINT_DEFAULT  =&H00000002
    %SPINT_REMOVED  =&H00000004
    
    
    '  Backward compatibility--do not use.
    
    MACRO SP_INTERFACE_DEVICE_DATA = SP_DEVICE_INTERFACE_DATA
    
    %SPID_ACTIVE              = %SPINT_ACTIVE
    %SPID_DEFAULT             = %SPINT_DEFAULT
    %SPID_REMOVED             = %SPINT_REMOVED
    
    TYPE SP_DEVICE_INTERFACE_DETAIL_DATA
         cbSize AS DWORD
         DevicePath AS BYTE PTR       ' Byte array. ANSI or UNICODE strings.
    END TYPE
    
    MACRO SP_DEVICE_INTERFACE_DETAIL_DATA_A = SP_DEVICE_INTERFACE_DETAIL_DATA
    MACRO SP_DEVICE_INTERFACE_DETAIL_DATA_W = SP_DEVICE_INTERFACE_DETAIL_DATA
    
    
    '  Structure for detailed information on a device information set (used for
    '  SetupDiGetDeviceInfoListDetail which supercedes the functionality of
    '  SetupDiGetDeviceInfoListClass).
    
    TYPE SP_DEVINFO_LIST_DETAIL_DATA_A
         cbSize AS DWORD
         ClassGuid AS GUID
         RemoteMachineHandle AS DWORD
         RemoteMachineName AS ASCIIZ * %SP_MAX_MACHINENAME_LENGTH
    END TYPE
    
    TYPE SP_DEVINFO_LIST_DETAIL_DATA_W
         cbSize AS DWORD
         ClassGuid AS GUID
         RemoteMachineHandle AS DWORD
         RemoteMachineName AS STRING * (%SP_MAX_MACHINENAME_LENGTH*2)  ' Must use fixed string for this UNICODE.
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_DEVINFO_LIST_DETAIL_DATA = SP_DEVINFO_LIST_DETAIL_DATA_W
    #ELSE
        MACRO SP_DEVINFO_LIST_DETAIL_DATA = SP_DEVINFO_LIST_DETAIL_DATA_A
    #ENDIF
    
    
    '  Class installer function codes
    
    %DIF_SELECTDEVICE                   = &H00000001
    %DIF_INSTALLDEVICE                  = &H00000002
    %DIF_ASSIGNRESOURCES                = &H00000003
    %DIF_PROPERTIES                     = &H00000004
    %DIF_REMOVE                         = &H00000005
    %DIF_FIRSTTIMESETUP                 = &H00000006
    %DIF_FOUNDDEVICE                    = &H00000007
    %DIF_SELECTCLASSDRIVERS             = &H00000008
    %DIF_VALIDATECLASSDRIVERS           = &H00000009
    %DIF_INSTALLCLASSDRIVERS            = &H0000000A
    %DIF_CALCDISKSPACE                  = &H0000000B
    %DIF_DESTROYPRIVATEDATA             = &H0000000C
    %DIF_VALIDATEDRIVER                 = &H0000000D
    %DIF_DETECT                         = &H0000000F
    %DIF_INSTALLWIZARD                  = &H00000010
    %DIF_DESTROYWIZARDDATA              = &H00000011
    %DIF_PROPERTYCHANGE                 = &H00000012
    %DIF_ENABLECLASS                    = &H00000013
    %DIF_DETECTVERIFY                   = &H00000014
    %DIF_INSTALLDEVICEFILES             = &H00000015
    %DIF_UNREMOVE                       = &H00000016
    %DIF_SELECTBESTCOMPATDRV            = &H00000017
    %DIF_ALLOW_INSTALL                  = &H00000018
    %DIF_REGISTERDEVICE                 = &H00000019
    %DIF_NEWDEVICEWIZARD_PRESELECT      = &H0000001A
    %DIF_NEWDEVICEWIZARD_SELECT         = &H0000001B
    %DIF_NEWDEVICEWIZARD_PREANALYZE     = &H0000001C
    %DIF_NEWDEVICEWIZARD_POSTANALYZE    = &H0000001D
    %DIF_NEWDEVICEWIZARD_FINISHINSTALL  = &H0000001E
    %DIF_UNUSED1                        = &H0000001F
    %DIF_INSTALLINTERFACES              = &H00000020
    %DIF_DETECTCANCEL                   = &H00000021
    %DIF_REGISTER_COINSTALLERS          = &H00000022
    %DIF_ADDPROPERTYPAGE_ADVANCED       = &H00000023
    %DIF_ADDPROPERTYPAGE_BASIC          = &H00000024
    %DIF_RESERVED1                      = &H00000025
    %DIF_TROUBLESHOOTER                 = &H00000026
    %DIF_POWERMESSAGEWAKE               = &H00000027
    %DIF_ADDREMOTEPROPERTYPAGE_ADVANCED = &H00000028
    %DIF_UPDATEDRIVER_UI                = &H00000029
    %DIF_RESERVED2                      = &H00000030
    
    '
    '  Obsoleted DIF codes (do not use)
    '
    %DIF_MOVEDEVICE                     = &H0000000E
    
    
    MACRO DI_FUNCTION = DWORD   '  Function type for device installer
    
    
    '  Device installation parameters structure (associated with a
    '  particular device information element, or globally with a device
    '  information set)
    
    TYPE SP_DEVINSTALL_PARAMS_A
         cbSize AS DWORD
         Flags AS DWORD
         FlagsEx AS DWORD
         hwndParent AS LONG
         InstallMsgHandler AS DWORD        ' Code pointer to a PSP_FILE_CALLBACK function.
         InstallMsgHandlerContext AS LONG
         FileQueue AS HSPFILEQ
         ClassInstallReserved AS DWORD
         Reserved AS DWORD
         DriverPath AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE SP_DEVINSTALL_PARAMS_W
         cbSize AS DWORD
         Flags AS DWORD
         FlagsEx AS DWORD
         hwndParent AS LONG
         InstallMsgHandler AS DWORD        ' Code pointer to a PSP_FILE_CALLBACK function.
         InstallMsgHandlerContext AS LONG
         FileQueue AS HSPFILEQ
         ClassInstallReserved AS DWORD
         Reserved AS DWORD
         DriverPath AS STRING * %MAX_PATH * 2
    END TYPE
    
    
    #IF %DEF(%UNICODE)
        MACRO SP_DEVINSTALL_PARAMS = SP_DEVINSTALL_PARAMS_W
    #ELSE
        MACRO SP_DEVINSTALL_PARAMS = SP_DEVINSTALL_PARAMS_A
    #ENDIF
    
    
    '
    '  SP_DEVINSTALL_PARAMS.Flags values
    '
    '  Flags for choosing a device
    '
    %DI_SHOWOEM                  = &H00000001&     '  support Other... button
    %DI_SHOWCOMPAT               = &H00000002&     '  show compatibility list
    %DI_SHOWCLASS                = &H00000004&     '  show class list
    %DI_SHOWALL                  = &H00000007&     '  both class & compat list shown
    %DI_NOVCP                    = &H00000008&     '  don't create a new copy queue--use
                                                        '  caller-supplied FileQueue
    %DI_DIDCOMPAT                = &H00000010&     '  Searched for compatible devices
    %DI_DIDCLASS                 = &H00000020&     '  Searched for class devices
    %DI_AUTOASSIGNRES            = &H00000040&     '  No UI for resources if possible
    
    '  flags returned by DiInstallDevice to indicate need to reboot/restart
    %DI_NEEDRESTART              = &H00000080&     '  Reboot required to take effect
    %DI_NEEDREBOOT               = &H00000100&     '  ""
    
    '  flags for device installation
    %DI_NOBROWSE                 = &H00000200&     '  no Browse... in InsertDisk
    
    '  Flags set by DiBuildDriverInfoList
    %DI_MULTMFGS                 = &H00000400&     '  Set if multiple manufacturers in
                                                        '  class driver list
    
    '  Flag indicates that device is disabled
    %DI_DISABLED                 = &H00000800&     '  Set if device disabled
    
    '  Flags for Device/Class Properties
    %DI_GENERALPAGE_ADDED        = &H00001000&
    %DI_RESOURCEPAGE_ADDED       = &H00002000&
    
    '  Flag to indicate the setting properties for this Device (or class) caused a change
    '  so the Dev Mgr UI probably needs to be updatd.
    %DI_PROPERTIES_CHANGE        = &H00004000&
    
    '  Flag to indicate that the sorting from the INF file should be used.
    %DI_INF_IS_SORTED            = &H00008000&
    
    '  Flag to indicate that only the the INF specified by SP_DEVINSTALL_PARAMS.DriverPath
    '  should be searched.
    %DI_ENUMSINGLEINF            = &H00010000&
    
    '  Flag that prevents ConfigMgr from removing/re-enumerating devices during device
    '  registration, installation, and deletion.
    %DI_DONOTCALLCONFIGMG        = &H00020000&
    
    '  The following flag can be used to install a device disabled
    %DI_INSTALLDISABLED          = &H00040000&
    
    '  Flag that causes SetupDiBuildDriverInfoList to build a device's compatible driver
    '  list from its existing class driver list, instead of the normal INF search.
    %DI_COMPAT_FROM_CLASS        = &H00080000&
    
    '  This flag is set if the Class Install params should be used.
    %DI_CLASSINSTALLPARAMS       = &H00100000&
    
    '  This flag is set if the caller of DiCallClassInstaller does NOT
    '  want the internal default action performed if the Class installer
    '  returns ERROR_DI_DO_DEFAULT.
    %DI_NODI_DEFAULTACTION       = &H00200000&
    
    '  The setupx flag, DI_NOSYNCPROCESSING (&H00400000&) is not support in the Setup APIs.
    
    '  flags for device installation
    %DI_QUIETINSTALL             = &H00800000&     '  don't confuse the user with
    '  questions or excess info
    %DI_NOFILECOPY               = &H01000000&     '  No file Copy necessary
    %DI_FORCECOPY                = &H02000000&     '  Force files to be copied from install path
    %DI_DRIVERPAGE_ADDED         = &H04000000&     '  Prop provider added Driver page.
    %DI_USECI_SELECTSTRINGS      = &H08000000&     '  Use Class Installer Provided strings in the Select Device Dlg
    %DI_OVERRIDE_INFFLAGS        = &H10000000&     '  Override INF flags
    %DI_PROPS_NOCHANGEUSAGE      = &H20000000&     '  No Enable/Disable in General Props
    
    %DI_NOSELECTICONS            = &H40000000&     '  No small icons in select device dialogs
    
    %DI_NOWRITE_IDS              = &H80000000&     '  Don't write HW And Compat IDs on install
    
    
    
    '  SP_DEVINSTALL_PARAMS.FlagsEx values
    
    %DI_FLAGSEX_USEOLDINFSEARCH          = &H00000001&  '  Inf Search functions should not use Index Search
    %DI_FLAGSEX_RESERVED2                = &H00000002&  '  DI_FLAGSEX_AUTOSELECTRANK0 is obsolete
    %DI_FLAGSEX_CI_FAILED                = &H00000004&  '  Failed to Load/Call class installer
    
    %DI_FLAGSEX_DIDINFOLIST              = &H00000010&  '  Did the Class Info List
    %DI_FLAGSEX_DIDCOMPATINFO            = &H00000020&  '  Did the Compat Info List
    
    %DI_FLAGSEX_FILTERCLASSES            = &H00000040&
    %DI_FLAGSEX_SETFAILEDINSTALL         = &H00000080&
    %DI_FLAGSEX_DEVICECHANGE             = &H00000100&
    %DI_FLAGSEX_ALWAYSWRITEIDS           = &H00000200&
    %DI_FLAGSEX_PROPCHANGE_PENDING       = &H00000400&  '  One or more device property sheets have had changes made
    '  to them, and need to have a DIF_PROPERTYCHANGE occur.
    %DI_FLAGSEX_ALLOWEXCLUDEDDRVS        = &H00000800&
    %DI_FLAGSEX_NOUIONQUERYREMOVE        = &H00001000&
    %DI_FLAGSEX_USECLASSFORCOMPAT        = &H00002000&  '  Use the device's class when building compat drv list.
    '  (Ignored if DI_COMPAT_FROM_CLASS flag is specified.)
    %DI_FLAGSEX_RESERVED3                = &H00004000&
    %DI_FLAGSEX_NO_DRVREG_MODIFY         = &H00008000&  '  Don't run AddReg and DelReg for device's software (driver) key.
    %DI_FLAGSEX_IN_SYSTEM_SETUP          = &H00010000&  '  Installation is occurring during initial system setup.
    %DI_FLAGSEX_INET_DRIVER              = &H00020000&  '  Driver came from Windows Update
    %DI_FLAGSEX_APPENDDRIVERLIST         = &H00040000&  '  Cause SetupDiBuildDriverInfoList to append
    '  a new driver list to an existing list.
    %DI_FLAGSEX_PREINSTALLBACKUP         = &H00080000&  '  backup all files required by old inf before install
    %DI_FLAGSEX_BACKUPONREPLACE          = &H00100000&  '  backup files required by old inf as they are replaced
    %DI_FLAGSEX_DRIVERLIST_FROM_URL      = &H00200000&  '  build driver list from INF(s) retrieved from URL specified
    '  in SP_DEVINSTALL_PARAMS.DriverPath (empty string means
    '  Windows Update website)
    %DI_FLAGSEX_RESERVED1                = &H00400000&
    %DI_FLAGSEX_EXCLUDE_OLD_INET_DRIVERS  =&H00800000&  '  Don't include old Internet drivers when building
    '  a driver list.
    %DI_FLAGSEX_POWERPAGE_ADDED          = &H01000000&  '  class installer added their own power page
    
    
    #IF %SETUPAPI_VER >= &H0501
    
    %DI_FLAGSEX_FILTERSIMILARDRIVERS     = &H02000000&  '  only include similar drivers in class list
    %DI_FLAGSEX_INSTALLEDDRIVER          = &H04000000&  '  only add the installed driver to the class or compat
    '  driver list.  Used in calls to SetupDiBuildDriverInfoList
    %DI_FLAGSEX_NO_CLASSLIST_NODE_MERGE  = &H08000000&  '  Don't remove identical driver nodes from the class list
    %DI_FLAGSEX_ALTPLATFORM_DRVSEARCH    = &H10000000&  '  Build driver list based on alternate platform information
    '  specified in associated file queue
    %DI_FLAGSEX_RESTART_DEVICE_ONLY      = &H20000000&  '  only restart the device drivers are being installed on as
    '  opposed to restarting all devices using those drivers.
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Class installation parameters header.  This must be the first field of any
    '  class install parameter structure.  The InstallFunction field must be set to
    '  the function code corresponding to the structure, and the cbSize field must
    '  be set to the size of the header structure.  E.g.,
    
    '  SP_ENABLECLASS_PARAMS EnableClassParams
    
    '  EnableClassParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER)
    '  EnableClassParams.ClassInstallHeader.InstallFunction = DIF_ENABLECLASS
    
    TYPE SP_CLASSINSTALL_HEADER
         cbSize AS DWORD
         InstallFunction AS DI_FUNCTION
    END TYPE
    
    
    
    '  Structure corresponding to a DIF_ENABLECLASS install function.
    
    TYPE SP_ENABLECLASS_PARAMS
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         ClassGuid AS GUID
         EnableMessage AS DWORD
    END TYPE
    
    %ENABLECLASS_QUERY   = 0
    %ENABLECLASS_SUCCESS  =1
    %ENABLECLASS_FAILURE  =2
    
    
    
    '  Values indicating a change in a device's state
    
    %DICS_ENABLE      = &H00000001
    %DICS_DISABLE     = &H00000002
    %DICS_PROPCHANGE  = &H00000003
    %DICS_START       = &H00000004
    %DICS_STOP        = &H00000005
    
    '  Values specifying the scope of a device property change
    
    %DICS_FLAG_GLOBAL         = &H00000001  '  make change in all hardware profiles
    %DICS_FLAG_CONFIGSPECIFIC  =&H00000002  '  make change in specified profile only
    %DICS_FLAG_CONFIGGENERAL  = &H00000004  '  1 or more hardware profile-specific
    '  changes to follow.
    
    '  Structure corresponding to a DIF_PROPERTYCHANGE install function.
    
    TYPE SP_PROPCHANGE_PARAMS
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         StateChange AS DWORD
         Scope AS DWORD
         HwProfile AS DWORD
    END TYPE
    
    
    
    '  Structure corresponding to a DIF_REMOVE install function.
    
    TYPE SP_REMOVEDEVICE_PARAMS
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Scope AS DWORD
         HwProfile AS DWORD
    END TYPE
    
    %DI_REMOVEDEVICE_GLOBAL                  = &H00000001
    %DI_REMOVEDEVICE_CONFIGSPECIFIC          = &H00000002
    
    
    
    '  Structure corresponding to a DIF_UNREMOVE install function.
    
    TYPE SP_UNREMOVEDEVICE_PARAMS
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Scope AS DWORD
         HwProfile AS DWORD
    END TYPE
    
    %DI_UNREMOVEDEVICE_CONFIGSPECIFIC        = &H00000002
    
    
    
    '  Structure corresponding to a DIF_SELECTDEVICE install function.
    
    TYPE SP_SELECTDEVICE_PARAMS_A
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Title AS ASCIIZ * %MAX_TITLE_LEN
         Instructions AS ASCIIZ * %MAX_INSTRUCTION_LEN
         ListLabel AS ASCIIZ * %MAX_LABEL_LEN
         SubTitle AS ASCIIZ * %MAX_SUBTITLE_LEN
         Reserved(2) AS BYTE                   '  DWORD size alignment
    END TYPE
    
    TYPE SP_SELECTDEVICE_PARAMS_W
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Title AS STRING * %MAX_TITLE_LEN * 2
         Instructions AS STRING * %MAX_INSTRUCTION_LEN * 2
         ListLabel AS STRING * %MAX_LABEL_LEN * 2
         SubTitle AS STRING * %MAX_SUBTITLE_LEN * 2
    END TYPE
    
    
    #IF %DEF(%UNICODE)
        MACRO SP_SELECTDEVICE_PARAMS = SP_SELECTDEVICE_PARAMS_W
    #ELSE
        MACRO SP_SELECTDEVICE_PARAMS = SP_SELECTDEVICE_PARAMS_A
    #ENDIF
    
    
    '
    '  Callback routine for giving progress notification during detection
    '
    DECLARE FUNCTION DETECT_PROGRESS_NOTIFY(BYVAL ProgressNotifyParam AS DWORD, BYVAL DetectComplete AS DWORD) AS LONG
    
    '  where:
    '      ProgressNotifyParam - value supplied by caller requesting detection.
    '      DetectComplete - Percent completion, to be incremented by class
    '                       installer, as it steps thru its detection.
    '
    '  Return Value - If TRUE, then detection is cancelled.  Allows caller
    '                 requesting detection to stop detection asap.
    '
    
    
    '  Structure corresponding to a DIF_DETECT install function.
    
    TYPE SP_DETECTDEVICE_PARAMS
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         DetectProgressNotify AS DWORD ' Code pointer to DETECT_PROGRESS_NOTIFY function
         ProgressNotifyParam AS LONG
    END TYPE
    
    
    
    '  'Add New Device' installation wizard structure (backward-compatibility
    '  only--respond to DIF_NEWDEVICEWIZARD_* requests instead).
    
    '  Structure corresponding to a DIF_INSTALLWIZARD install function.
    '  (NOTE: This structure is also applicable for DIF_DESTROYWIZARDDATA,
    '  but DIF_INSTALLWIZARD is the associated function code in the class
    '  installation parameter structure in both cases.)
    
    '  Define maximum number of dynamic wizard pages that can be added to
    '  hardware install wizard.
    
    %MAX_INSTALLWIZARD_DYNAPAGES             = 20
    
    TYPE SP_INSTALLWIZARD_DATA
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Flags AS DWORD
         DynamicPages(%MAX_INSTALLWIZARD_DYNAPAGES) AS DWORD
         NumDynamicPages AS DWORD
         DynamicPageFlags AS DWORD
         PrivateFlags AS DWORD
         PrivateData AS LONG
         hwndWizardDlg AS LONG
    END TYPE
    
    
    '  SP_INSTALLWIZARD_DATA.Flags values
    
    %NDW_INSTALLFLAG_DIDFACTDEFS         = &H00000001
    %NDW_INSTALLFLAG_HARDWAREALLREADYIN  = &H00000002
    %NDW_INSTALLFLAG_NEEDRESTART         = %DI_NEEDRESTART
    %NDW_INSTALLFLAG_NEEDREBOOT          = %DI_NEEDREBOOT
    %NDW_INSTALLFLAG_NEEDSHUTDOWN        = &H00000200
    %NDW_INSTALLFLAG_EXPRESSINTRO        = &H00000400
    %NDW_INSTALLFLAG_SKIPISDEVINSTALLED  = &H00000800
    %NDW_INSTALLFLAG_NODETECTEDDEVS      = &H00001000
    %NDW_INSTALLFLAG_INSTALLSPECIFIC     = &H00002000
    %NDW_INSTALLFLAG_SKIPCLASSLIST       = &H00004000
    %NDW_INSTALLFLAG_CI_PICKED_OEM       = &H00008000
    %NDW_INSTALLFLAG_PCMCIAMODE          = &H00010000
    %NDW_INSTALLFLAG_PCMCIADEVICE        = &H00020000
    %NDW_INSTALLFLAG_USERCANCEL          = &H00040000
    %NDW_INSTALLFLAG_KNOWNCLASS          = &H00080000
    
    
    
    '  SP_INSTALLWIZARD_DATA.DynamicPageFlags values
    
    '  This flag is set if a Class installer has added pages to the install wizard.
    
    %DYNAWIZ_FLAG_PAGESADDED             = &H00000001
    
    
    '  Set this flag if you jump to the analyze page, and want it to
    '  handle conflicts for you.  NOTE.  You will not get control back
    '  in the event of a conflict if you set this flag.
    
    %DYNAWIZ_FLAG_ANALYZE_HANDLECONFLICT  =&H00000008
    
    
    '  The following flags are not used by the Windows NT hardware wizard.
    
    %DYNAWIZ_FLAG_INSTALLDET_NEXT        = &H00000002
    %DYNAWIZ_FLAG_INSTALLDET_PREV        = &H00000004
    
    
    
    '  Reserve a range of wizard page resource IDs for internal use.  Some of
    '  these IDs are for use by class installers that respond to the obsolete
    '  DIF_INSTALLWIZARD/DIF_DESTROYWIZARDDATA messages.  These IDs are listed
    '  below.
    
    %MIN_IDD_DYNAWIZ_RESOURCE_ID             = 10000
    %MAX_IDD_DYNAWIZ_RESOURCE_ID             = 11000
    
    
    '  Define wizard page resource IDs to be used when adding custom pages to the
    '  hardware install wizard via DIF_INSTALLWIZARD.  Pages marked with
    '  (CLASS INSTALLER PROVIDED) _must_ be supplied by the class installer if it
    '  responds to the DIF_INSTALLWIZARD request.
    
    
    
    '  Resource ID for the first page that the install wizard will go to after
    '  adding the class installer pages.  (CLASS INSTALLER PROVIDED)
    
    %IDD_DYNAWIZ_FIRSTPAGE                   = 10000
    
    
    '  Resource ID for the page that the Select Device page will go back to.
    '  (CLASS INSTALLER PROVIDED)
    
    %IDD_DYNAWIZ_SELECT_PREVPAGE             = 10001
    
    
    '  Resource ID for the page that the Select Device page will go forward to.
    '  (CLASS INSTALLER PROVIDED)
    
    %IDD_DYNAWIZ_SELECT_NEXTPAGE             = 10002
    
    
    '  Resource ID for the page that the Analyze dialog should go back to
    '  This will only be used in the event that there is a problem, and the user
    '  selects Back from the analyze proc. (CLASS INSTALLER PROVIDED)
    
    %IDD_DYNAWIZ_ANALYZE_PREVPAGE            = 10003
    
    
    '  Resource ID for the page that the Analyze dialog should go to if it
    '  continues from the analyze proc. (CLASS INSTALLER PROVIDED)
    
    %IDD_DYNAWIZ_ANALYZE_NEXTPAGE            = 10004
    
    
    '  Resource ID of the hardware install wizard's select device page.
    '  This ID can be used to go directly to the hardware install wizard's select
    '  device page.  (This is the resource ID of the Select Device wizard page
    '  retrieved via SetupDiGetWizardPage when SPWPT_SELECTDEVICE is the requested
    '  PageType.)
    
    %IDD_DYNAWIZ_SELECTDEV_PAGE              = 10009
    
    
    '  Resource ID of the hardware install wizard's device analysis page.
    '  This ID can be use to go directly to the hardware install wizard's analysis
    '  page.
    
    %IDD_DYNAWIZ_ANALYZEDEV_PAGE             = 10010
    
    
    '  Resource ID of the hardware install wizard's install detected devices page.
    '  This ID can be use to go directly to the hardware install wizard's install
    '  detected devices page.
    
    %IDD_DYNAWIZ_INSTALLDETECTEDDEVS_PAGE    = 10011
    
    
    '  Resource ID of the hardware install wizard's select class page.
    '  This ID can be use to go directly to the hardware install wizard's select
    '  class page.
    
    %IDD_DYNAWIZ_SELECTCLASS_PAGE            = 10012
    
    
    '  The following class installer-provided wizard page resource IDs are not used
    '  by the Windows NT hardware wizard.
    
    %IDD_DYNAWIZ_INSTALLDETECTED_PREVPAGE    = 10006
    %IDD_DYNAWIZ_INSTALLDETECTED_NEXTPAGE    = 10007
    %IDD_DYNAWIZ_INSTALLDETECTED_NODEVS      = 10008
    
    
    
    '  Structure corresponding to the following DIF_NEWDEVICEWIZARD_* install
    '  functions:
    
    '      DIF_NEWDEVICEWIZARD_PRESELECT
    '      DIF_NEWDEVICEWIZARD_SELECT
    '      DIF_NEWDEVICEWIZARD_PREANALYZE
    '      DIF_NEWDEVICEWIZARD_POSTANALYZE
    '      DIF_NEWDEVICEWIZARD_FINISHINSTALL
    
    TYPE SP_NEWDEVICEWIZARD_DATA
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         Flags AS DWORD                        '  presently unused--must be zero.
         DynamicPages(%MAX_INSTALLWIZARD_DYNAPAGES) AS DWORD
         NumDynamicPages AS DWORD
         hwndWizardDlg AS LONG
    END TYPE
    
    
    '  The same structure is also used for retrieval of property pages via the
    '  following install functions:
    
    '      DIF_ADDPROPERTYPAGE_ADVANCED
    '      DIF_ADDPROPERTYPAGE_BASIC
    '      DIF_ADDREMOTEPROPERTYPAGE_ADVANCED
    
    MACRO SP_ADDPROPERTYPAGE_DATA = SP_NEWDEVICEWIZARD_DATA
    
    
    '
    '  Structure corresponding to the DIF_TROUBLESHOOTER install function
    '
    TYPE SP_TROUBLESHOOTER_PARAMS_A
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         ChmFile AS ASCIIZ * %MAX_PATH
         HtmlTroubleShooter AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE SP_TROUBLESHOOTER_PARAMS_W
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         ChmFile AS STRING * %MAX_PATH * 2
         HtmlTroubleShooter AS STRING * %MAX_PATH
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_TROUBLESHOOTER_PARAMS = SP_TROUBLESHOOTER_PARAMS_W
    #ELSE
        MACRO SP_TROUBLESHOOTER_PARAMS = SP_TROUBLESHOOTER_PARAMS_A
    #ENDIF
    
    
    '
    '  Structure corresponding to the DIF_POWERMESSAGEWAKE install function
    '
    TYPE SP_POWERMESSAGEWAKE_PARAMS_A
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         PowerMessageWake AS ASCIIZ * %LINE_LEN * 2
    END TYPE
    
    TYPE SP_POWERMESSAGEWAKE_PARAMS_W
         ClassInstallHeader AS SP_CLASSINSTALL_HEADER
         PowerMessageWake AS STRING * %LINE_LEN * 4
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_POWERMESSAGEWAKE_PARAMS = SP_POWERMESSAGEWAKE_PARAMS_W
    #ELSE
        MACRO SP_POWERMESSAGEWAKE_PARAMS = SP_POWERMESSAGEWAKE_PARAMS_A
    #ENDIF
    
    '
    '  Driver information structure (member of a driver info list that may be associated
    '  with a particular device instance, or (globally) with a device information set)
    '
    TYPE SP_DRVINFO_DATA_V2_A
         cbSize AS DWORD
         DriverType AS DWORD
         Reserved AS DWORD
         Description AS ASCIIZ * %LINE_LEN
         MfgName AS ASCIIZ * %LINE_LEN
         ProviderName AS ASCIIZ * %LINE_LEN
         DriverDate AS FILETIME
         DriverVersion AS DWORD
    END TYPE
    
    TYPE SP_DRVINFO_DATA_V2_W
         cbSize AS DWORD
         DriverType AS DWORD
         Reserved AS DWORD
         Description AS STRING * %LINE_LEN * 2
         MfgName AS STRING * %LINE_LEN * 2
         ProviderName AS STRING * %LINE_LEN * 2
         DriverDate AS FILETIME
         DriverVersion AS DWORD
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_DRVINFO_DATA_V2 = SP_DRVINFO_DATA_V2_W
    #ELSE
        MACRO SP_DRVINFO_DATA_V2 = SP_DRVINFO_DATA_V2_A
    #ENDIF
    
    
    '  Version 1 of the SP_DRVINFO_DATA structures, used only for compatibility
    '  with Windows NT 4.0/Windows 95/98 SETUPAPI.DLL
    
    TYPE SP_DRVINFO_DATA_V1_A
         cbSize AS DWORD
         DriverType AS DWORD
         Reserved AS DWORD
         Description AS ASCIIZ * %LINE_LEN
         MfgName AS ASCIIZ * %LINE_LEN
         ProviderName AS ASCIIZ * %LINE_LEN
    END TYPE
    
    TYPE SP_DRVINFO_DATA_V1_W
         cbSize AS DWORD
         DriverType AS DWORD
         Reserved AS DWORD
         Description AS STRING * %LINE_LEN * 2
         MfgName AS STRING * %LINE_LEN * 2
         ProviderName AS STRING * %LINE_LEN * 2
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_DRVINFO_DATA_V1 = SP_DRVINFO_DATA_V1_W
    #ELSE
        MACRO SP_DRVINFO_DATA_V1 = SP_DRVINFO_DATA_V1_A
    #ENDIF
    
    
    #IF (%SETUPAPI_VER < &H0500)  ' use version 1 driver info data structure
    
        MACRO SP_DRVINFO_DATA   = SP_DRVINFO_DATA_V1
        MACRO SP_DRVINFO_DATA_A = SP_DRVINFO_DATA_V1
        MACRO SP_DRVINFO_DATA_W = SP_DRVINFO_DATA_V1
    
    #ELSE                       ' use version 2 driver info data structure
    
        MACRO SP_DRVINFO_DATA   = SP_DRVINFO_DATA_V2
        MACRO SP_DRVINFO_DATA_A = SP_DRVINFO_DATA_V2
        MACRO SP_DRVINFO_DATA_W = SP_DRVINFO_DATA_V2
    
    #ENDIF  ' use current version of driver info data structure
    
    
    
    '  Driver information details structure (provides detailed information about a
    '  particular driver information structure)
    
    TYPE SP_DRVINFO_DETAIL_DATA_A
         cbSize AS DWORD
         InfDate AS FILETIME
         CompatIDsOffset AS DWORD
         CompatIDsLength AS DWORD
         Reserved AS DWORD
         SectionName AS ASCIIZ * %LINE_LEN
         InfFileName AS ASCIIZ * %MAX_PATH
         DrvDescription AS ASCIIZ * %LINE_LEN
         HardwareID AS ASCIIZ * %ANYSIZE_ARRAY
    END TYPE
    
    TYPE SP_DRVINFO_DETAIL_DATA_W
         cbSize AS DWORD
         InfDate AS FILETIME
         CompatIDsOffset AS DWORD
         CompatIDsLength AS DWORD
         Reserved AS DWORD
         SectionName AS STRING * %LINE_LEN * 2
         InfFileName AS STRING * %MAX_PATH * 2
         DrvDescription AS STRING * %LINE_LEN * 2
         HardwareID AS STRING * %ANYSIZE_ARRAY * 2
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_DRVINFO_DETAIL_DATA = SP_DRVINFO_DETAIL_DATA_W
    #ELSE
        MACRO SP_DRVINFO_DETAIL_DATA = SP_DRVINFO_DETAIL_DATA_A
    #ENDIF
    
    
    
    ' Driver installation parameters (associated with a particular driver
    ' information element)
    
    TYPE SP_DRVINSTALL_PARAMS
         cbSize AS DWORD
         Rank AS DWORD
         Flags AS DWORD
         PrivateData AS DWORD
         Reserved AS DWORD
    END TYPE
    
    
    '  SP_DRVINSTALL_PARAMS.Flags values
    
    %DNF_DUPDESC             = &H00000001  '  Multiple providers have same desc
    %DNF_OLDDRIVER           = &H00000002  '  Driver node specifies old/current driver
    %DNF_EXCLUDEFROMLIST     = &H00000004  '  If set, this driver node will not be
    '  displayed in any driver select dialogs.
    %DNF_NODRIVER            = &H00000008  '  if we want to install no driver
    '  (e.g no mouse drv)
    %DNF_LEGACYINF           = &H00000010  '  Driver node came from an old-style INF (obsolete)
    %DNF_CLASS_DRIVER        = &H00000020  '  Driver node represents a class driver
    %DNF_COMPATIBLE_DRIVER   = &H00000040  '  Driver node represents a compatible driver
    %DNF_INET_DRIVER         = &H00000080  '  Driver comes from an internet source
    %DNF_UNUSED1             = &H00000100
    %DNF_INDEXED_DRIVER      = &H00000200  '  Driver is contained in the Windows Driver Index
    %DNF_OLD_INET_DRIVER     = &H00000400  '  Driver came from the Internet, but we don't currently
    '  have access to it's source files.  Never attempt to
    '  install a driver with this flag!
    %DNF_BAD_DRIVER          = &H00000800  '  Driver node should not be used at all
    %DNF_DUPPROVIDER         = &H00001000  '  Multiple drivers have the same provider and desc
    
    #IF %SETUPAPI_VER >= &H0501
    %DNF_INF_IS_SIGNED       = &H00002000  '  If file is digitally signed
    %DNF_OEM_F6_INF          = &H00004000  '  INF specified from F6 during textmode setup.
    %DNF_DUPDRIVERVER        = &H00008000  '  Multipe drivers have the same desc, provider, and DriverVer values
    %DNF_BASIC_DRIVER        = &H00010000  '  Driver provides basic functionality, but should
    '  not be chosen if other signed drivers exist.
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    #IF %SETUPAPI_VER >= &H0502
        %DNF_AUTHENTICODE_SIGNED  =&H00020000  '  Inf file is signed by an Authenticode(tm) catalog.
    #ENDIF '  %SETUPAPI_VER >= &H0502
    
    
    '  Rank values (the lower the Rank number, the better the Rank)
    
    %DRIVER_HARDWAREID_RANK  = &H00000FFF  '  Any rank less than or equal to
    '  this value is a trusted
    '  HardwareID match
    
    %DRIVER_COMPATID_RANK    = &H00003FFF  '  Any rank less than or equal to
    '  this (and greater than
    '  DRIVER_HARDWAREID_RANK) is a
    '  trusted CompatibleID match
    
    %DRIVER_UNTRUSTED_RANK   = &H00008000  '  Any rank with this bit set is an
    '  "untrusted" rank, meaning that
    '  the INF was unsigned.
    
    %DRIVER_UNTRUSTED_HARDWAREID_RANK  = &H00008FFF  '  Any rank less than or equal to
    '  this value (and greater than
    '  or equal to DRIVER_UNTRUSTED_RANK)
    '  is an untrusted HardwareID match
    
    %DRIVER_UNTRUSTED_COMPATID_RANK    = &H0000BFFF  '  Any rank less than or equal to
    '  this value (and greater than
    '  DRIVER_UNTRUSTED_HARDWAREID_RANK)
    '  is an untrusted CompatibleID match
    
    %DRIVER_W9X_SUSPECT_RANK            = &H0000C000 '  Any rank that is greater than
    '  or equal to this value, and lesser
    '  than or equal to &HFFFF is suspected
    '  to be a Win9x-only driver, because
    '  (a) it isn't signed, and (b) there
    '  is no NT-specific decoration to
    '  explicitly indicate that the INF
    '  supports Windows NT/2000/XP
    
    %DRIVER_W9X_SUSPECT_HARDWAREID_RANK  =&H0000CFFF '  Any rank less than or equal to this
    '  (and greater than or equal to
    '  DRIVER_W9X_SUSPECT_RANK) is a
    '  hardware ID match suspected of being
    '  only for Windows 9x platforms.
    
    %DRIVER_W9X_SUSPECT_COMPATID_RANK   = &H0000FFFF '  Any rank less than or equal to
    '  this (and greater than
    '  DRIVER_W9X_SUSPECT_HARDWAREID_RANK)
    '  is a compatible ID match suspected
    '  of being only for Windows 9x
    '  platforms.
    
    
    '  Setup callback routine for comparing detection signatures
    
    DECLARE FUNCTION SP_DETSIG_CMPPROC(BYREF NewDeviceData AS SP_DEVINFO_DATA, BYREF ExistingDeviceData AS SP_DEVINFO_DATA, BYREF CompareContext AS ANY) AS DWORD
    
    
    TYPE COINSTALLER_CONTEXT_DATA
         PostProcessing AS LONG
         InstallResult AS DWORD
         PrivateData AS LONG
    END TYPE
    
    
    '  Structure containing class image list information.
    
    TYPE SP_CLASSIMAGELIST_DATA
         cbSize AS DWORD
         ImageList AS DWORD
         Reserved AS DWORD
    END TYPE
    
    
    '  Structure to be passed as first parameter (LPVOID lpv) to ExtensionPropSheetPageProc
    '  entry point in setupapi.dll or to "EnumPropPages32" or "BasicProperties32" entry
    '  points provided by class/device property page providers.  Used to retrieve a handle
    '  (or, potentially, multiple handles) to property pages for a specified property page type.
    
    TYPE SP_PROPSHEETPAGE_REQUEST
         cbSize AS DWORD
         PageRequested AS DWORD
         DeviceInfoSet AS HDEVINFO
         DeviceInfoData AS SP_DEVINFO_DATA PTR
    END TYPE
    
    
    '  Property sheet codes used in SP_PROPSHEETPAGE_REQUEST.PageRequested
    
    %SPPSR_SELECT_DEVICE_RESOURCES      = 1    '  supplied by setupapi.dll
    %SPPSR_ENUM_BASIC_DEVICE_PROPERTIES = 2    '  supplied by device's BasicProperties32 provider
    %SPPSR_ENUM_ADV_DEVICE_PROPERTIES   = 3    '  supplied by class and/or device's EnumPropPages32 provider
    
    
    '  Structure used with SetupGetBackupInformation/SetupSetBackupInformation
    
    TYPE SP_BACKUP_QUEUE_PARAMS_V2_A
         cbSize AS DWORD                       '  size of structure
         FullInfPath AS ASCIIZ * %MAX_PATH     '  buffer to hold ANSI pathname of INF file
         FilenameOffset AS LONG                '  offset in CHAR's of filename part (after '\')
         ReinstallInstance AS ASCIIZ * %MAX_PATH  '  Instance ID (if present)
    END TYPE
    
    TYPE SP_BACKUP_QUEUE_PARAMS_V2_W
         cbSize AS DWORD                       '  size of structure
         FullInfPath AS STRING * %MAX_PATH * 2 '  buffer to hold UNICODE pathname of INF file
         FilenameOffset AS LONG                '  offset in WCHAR's of filename part (after '\')
         ReinstallInstance AS STRING * %MAX_PATH * 2 '  Instance ID (if present)
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_BACKUP_QUEUE_PARAMS_V2 = SP_BACKUP_QUEUE_PARAMS_V2_W
    #ELSE
        MACRO SP_BACKUP_QUEUE_PARAMS_V2 = SP_BACKUP_QUEUE_PARAMS_V2_A
    #ENDIF
    
    
    '  Version 1 of the SP_BACKUP_QUEUE_PARAMS structures, used only for compatibility
    '  with Windows 2000/Windows 95/98/ME SETUPAPI.DLL
    
    TYPE SP_BACKUP_QUEUE_PARAMS_V1_A
         cbSize AS DWORD                       '  size of structure
         FullInfPath AS ASCIIZ * %MAX_PATH     '  buffer to hold ANSI pathname of INF file
         FilenameOffset AS LONG                '  offset in CHAR's of filename part (after '\')
    END TYPE
    
    TYPE SP_BACKUP_QUEUE_PARAMS_V1_W
         cbSize AS DWORD                       '  size of structure
         FullInfPath AS ASCIIZ * %MAX_PATH     '  buffer to hold UNICODE pathname of INF file
         FilenameOffset AS LONG                '  offset in WCHAR's of filename part (after '\')
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_BACKUP_QUEUE_PARAMS_V1 = SP_BACKUP_QUEUE_PARAMS_V1_W
    #ELSE
        MACRO SP_BACKUP_QUEUE_PARAMS_V1 = SP_BACKUP_QUEUE_PARAMS_V1_A
    #ENDIF
    
    
    #IF %SETUPAPI_VER < &H0501
        MACRO SP_BACKUP_QUEUE_PARAMS   = SP_BACKUP_QUEUE_PARAMS_V1
        MACRO SP_BACKUP_QUEUE_PARAMS_A = SP_BACKUP_QUEUE_PARAMS_V1
        MACRO SP_BACKUP_QUEUE_PARAMS_W = SP_BACKUP_QUEUE_PARAMS_V1
    #ELSE
        MACRO SP_BACKUP_QUEUE_PARAMS   = SP_BACKUP_QUEUE_PARAMS_V2
        MACRO SP_BACKUP_QUEUE_PARAMS_A = SP_BACKUP_QUEUE_PARAMS_V2
        MACRO SP_BACKUP_QUEUE_PARAMS_W = SP_BACKUP_QUEUE_PARAMS_V2
    #ENDIF
    
    
    '
    ' Setupapi-specific error codes
    '
    ' Inf parse outcomes
    '
    %ERROR_EXPECTED_SECTION_NAME  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR 0)
    %ERROR_BAD_SECTION_NAME_LINE  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR 1)
    %ERROR_SECTION_NAME_TOO_LONG  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR 2)
    %ERROR_GENERAL_SYNTAX         = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR 3)
    
    '  Inf runtime errors
    
    %ERROR_WRONG_INF_STYLE        = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H100)
    %ERROR_SECTION_NOT_FOUND      = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H101)
    %ERROR_LINE_NOT_FOUND         = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H102)
    %ERROR_NO_BACKUP              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H103)
    
    '  Device Installer/other errors
    
    %ERROR_NO_ASSOCIATED_CLASS                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H200)
    %ERROR_CLASS_MISMATCH                     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H201)
    %ERROR_DUPLICATE_FOUND                    = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H202)
    %ERROR_NO_DRIVER_SELECTED                 = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H203)
    %ERROR_KEY_DOES_NOT_EXIST                 = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H204)
    %ERROR_INVALID_DEVINST_NAME               = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H205)
    %ERROR_INVALID_CLASS                      = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H206)
    %ERROR_DEVINST_ALREADY_EXISTS             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H207)
    %ERROR_DEVINFO_NOT_REGISTERED             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H208)
    %ERROR_INVALID_REG_PROPERTY               = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H209)
    %ERROR_NO_INF                             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20A)
    %ERROR_NO_SUCH_DEVINST                    = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20B)
    %ERROR_CANT_LOAD_CLASS_ICON               = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20C)
    %ERROR_INVALID_CLASS_INSTALLER            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20D)
    %ERROR_DI_DO_DEFAULT                      = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20E)
    %ERROR_DI_NOFILECOPY                      = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H20F)
    %ERROR_INVALID_HWPROFILE                  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H210)
    %ERROR_NO_DEVICE_SELECTED                 = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H211)
    %ERROR_DEVINFO_LIST_LOCKED                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H212)
    %ERROR_DEVINFO_DATA_LOCKED                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H213)
    %ERROR_DI_BAD_PATH                        = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H214)
    %ERROR_NO_CLASSINSTALL_PARAMS             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H215)
    %ERROR_FILEQUEUE_LOCKED                   = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H216)
    %ERROR_BAD_SERVICE_INSTALLSECT            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H217)
    %ERROR_NO_CLASS_DRIVER_LIST               = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H218)
    %ERROR_NO_ASSOCIATED_SERVICE              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H219)
    %ERROR_NO_DEFAULT_DEVICE_INTERFACE        = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21A)
    %ERROR_DEVICE_INTERFACE_ACTIVE            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21B)
    %ERROR_DEVICE_INTERFACE_REMOVED           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21C)
    %ERROR_BAD_INTERFACE_INSTALLSECT          = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21D)
    %ERROR_NO_SUCH_INTERFACE_CLASS            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21E)
    %ERROR_INVALID_REFERENCE_STRING           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H21F)
    %ERROR_INVALID_MACHINENAME                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H220)
    %ERROR_REMOTE_COMM_FAILURE                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H221)
    %ERROR_MACHINE_UNAVAILABLE                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H222)
    %ERROR_NO_CONFIGMGR_SERVICES              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H223)
    %ERROR_INVALID_PROPPAGE_PROVIDER          = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H224)
    %ERROR_NO_SUCH_DEVICE_INTERFACE           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H225)
    %ERROR_DI_POSTPROCESSING_REQUIRED         = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H226)
    %ERROR_INVALID_COINSTALLER                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H227)
    %ERROR_NO_COMPAT_DRIVERS                  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H228)
    %ERROR_NO_DEVICE_ICON                     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H229)
    %ERROR_INVALID_INF_LOGCONFIG              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22A)
    %ERROR_DI_DONT_INSTALL                    = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22B)
    %ERROR_INVALID_FILTER_DRIVER              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22C)
    %ERROR_NON_WINDOWS_NT_DRIVER              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22D)
    %ERROR_NON_WINDOWS_DRIVER                 = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22E)
    %ERROR_NO_CATALOG_FOR_OEM_INF             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H22F)
    %ERROR_DEVINSTALL_QUEUE_NONNATIVE         = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H230)
    %ERROR_NOT_DISABLEABLE                    = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H231)
    %ERROR_CANT_REMOVE_DEVINST                = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H232)
    %ERROR_INVALID_TARGET                     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H233)
    %ERROR_DRIVER_NONNATIVE                   = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H234)
    %ERROR_IN_WOW64                           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H235)
    %ERROR_SET_SYSTEM_RESTORE_POINT           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H236)
    %ERROR_INCORRECTLY_COPIED_INF             = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H237)
    %ERROR_SCE_DISABLED                       = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H238)
    %ERROR_UNKNOWN_EXCEPTION                  = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H239)
    %ERROR_PNP_REGISTRY_ERROR                 = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23A)
    %ERROR_REMOTE_REQUEST_UNSUPPORTED         = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23B)
    %ERROR_NOT_AN_INSTALLED_OEM_INF           = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23C)
    %ERROR_INF_IN_USE_BY_DEVICES              = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23D)
    %ERROR_DI_FUNCTION_OBSOLETE               = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23E)
    %ERROR_NO_AUTHENTICODE_CATALOG            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H23F)
    %ERROR_AUTHENTICODE_DISALLOWED            = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H240)
    %ERROR_AUTHENTICODE_TRUSTED_PUBLISHER     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H241)
    %ERROR_AUTHENTICODE_TRUST_NOT_ESTABLISHED  =(%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H242)
    %ERROR_AUTHENTICODE_PUBLISHER_NOT_TRUSTED  =(%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H243)
    %ERROR_SIGNATURE_OSATTRIBUTE_MISMATCH     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H244)
    %ERROR_ONLY_VALIDATE_VIA_AUTHENTICODE     = (%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H245)
    
    
    '  Setupapi exception codes
    
    %ERROR_UNRECOVERABLE_STACK_OVERFLOW  =(%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H300)
    %EXCEPTION_SPAPI_UNRECOVERABLE_STACK_OVERFLOW  =%ERROR_UNRECOVERABLE_STACK_OVERFLOW
    
    
    '  Backward compatibility--do not use.
    
    %ERROR_NO_DEFAULT_INTERFACE_DEVICE  =%ERROR_NO_DEFAULT_DEVICE_INTERFACE
    %ERROR_INTERFACE_DEVICE_ACTIVE     = %ERROR_DEVICE_INTERFACE_ACTIVE
    %ERROR_INTERFACE_DEVICE_REMOVED    = %ERROR_DEVICE_INTERFACE_REMOVED
    %ERROR_NO_SUCH_INTERFACE_DEVICE    = %ERROR_NO_SUCH_DEVICE_INTERFACE
    
    
    '  Win9x migration DLL error code
    
    %ERROR_NOT_INSTALLED  =(%APPLICATION_ERROR_MASK OR %ERROR_SEVERITY_ERROR OR &H1000)
    
    
    '  SearchControl flags for SetupGetInfInformation
    
    %INFINFO_INF_SPEC_IS_HINF        = 1
    %INFINFO_INF_NAME_IS_ABSOLUTE    = 2
    %INFINFO_DEFAULT_SEARCH          = 3
    %INFINFO_REVERSE_DEFAULT_SEARCH  = 4
    %INFINFO_INF_PATH_LIST_SEARCH    = 5
    
    '  Compression types
    
    %FILE_COMPRESSION_NONE       = 0
    %FILE_COMPRESSION_WINLZA     = 1
    %FILE_COMPRESSION_MSZIP      = 2
    %FILE_COMPRESSION_NTCAB      = 3
    
    '  Define flags for SourceList APIs.
    
    %SRCLIST_TEMPORARY       = &H00000001
    %SRCLIST_NOBROWSE        = &H00000002
    %SRCLIST_SYSTEM          = &H00000010
    %SRCLIST_USER            = &H00000020
    %SRCLIST_SYSIFADMIN      = &H00000040
    %SRCLIST_SUBDIRS         = &H00000100
    %SRCLIST_APPEND          = &H00000200
    %SRCLIST_NOSTRIPPLATFORM  =&H00000400
    
    '  Styles for SetupPromptForDisk, SetupCopyError,
    '  SetupRenameError, SetupDeleteError
    
    %IDF_NOBROWSE                    = &H00000001
    %IDF_NOSKIP                      = &H00000002
    %IDF_NODETAILS                   = &H00000004
    %IDF_NOCOMPRESSED                = &H00000008
    %IDF_CHECKFIRST                  = &H00000100
    %IDF_NOBEEP                      = &H00000200
    %IDF_NOFOREGROUND                = &H00000400
    %IDF_WARNIFSKIP                  = &H00000800
    
    #IF %SETUPAPI_VER >= &H0501
    
    %IDF_NOREMOVABLEMEDIAPROMPT      = &H00001000
    %IDF_USEDISKNAMEASPROMPT         = &H00002000
    %IDF_OEMDISK                     = &H80000000
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Return values for SetupPromptForDisk, SetupCopyError,
    '  SetupRenameError, SetupDeleteError, SetupBackupError
    
    %DPROMPT_SUCCESS         = 0
    %DPROMPT_CANCEL          = 1
    %DPROMPT_SKIPFILE        = 2
    %DPROMPT_BUFFERTOOSMALL  = 3
    %DPROMPT_OUTOFMEMORY     = 4
    
    '  Flags for SetupSetDirectoryIdEx
    
    %SETDIRID_NOT_FULL_PATH      = &H00000001
    
    
    '  InfoDesired values for SetupGetSourceInfo
    
    %SRCINFO_PATH            = 1
    %SRCINFO_TAGFILE         = 2
    %SRCINFO_DESCRIPTION     = 3
    %SRCINFO_FLAGS           = 4
    
    #IF %SETUPAPI_VER >= &H0501
    
    '  SRC_FLAGS allow special treatment of source
    '  lower 4 bits are reserved for OS use
    '  the flags may determine what other parameters exist
    
    %SRCINFO_TAGFILE2        = 5  '  alternate tagfile, when SRCINFO_TAGFILE is a cabfile
    
    %SRC_FLAGS_CABFILE       = (&H0010) '  if set, treat SRCINFO_TAGFILE as a cabfile and specify alternate tagfile
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    '  CopyStyle values for copy and queue-related APIs
    
    %SP_COPY_DELETESOURCE        = &H0000001   '  delete source file on successful copy
    %SP_COPY_REPLACEONLY         = &H0000002   '  copy only if target file already present
    %SP_COPY_NEWER               = &H0000004   '  copy only if source newer than or same as target
    %SP_COPY_NEWER_OR_SAME       = %SP_COPY_NEWER
    %SP_COPY_NOOVERWRITE         = &H0000008   '  copy only if target doesn't exist
    %SP_COPY_NODECOMP            = &H0000010   '  don't decompress source file while copying
    %SP_COPY_LANGUAGEAWARE       = &H0000020   '  don't overwrite file of different language
    %SP_COPY_SOURCE_ABSOLUTE     = &H0000040   '  SourceFile is a full source path
    %SP_COPY_SOURCEPATH_ABSOLUTE  =&H0000080   '  SourcePathRoot is the full path
    %SP_COPY_IN_USE_NEEDS_REBOOT  =&H0000100   '  System needs reboot if file in use
    %SP_COPY_FORCE_IN_USE        = &H0000200   '  Force target-in-use behavior
    %SP_COPY_NOSKIP              = &H0000400   '  Skip is disallowed for this file or section
    %SP_FLAG_CABINETCONTINUATION  =&H0000800   '  Used with need media notification
    %SP_COPY_FORCE_NOOVERWRITE   = &H0001000   '  like NOOVERWRITE but no callback nofitication
    %SP_COPY_FORCE_NEWER         = &H0002000   '  like NEWER but no callback nofitication
    %SP_COPY_WARNIFSKIP          = &H0004000   '  system critical file: warn if user tries to skip
    %SP_COPY_NOBROWSE            = &H0008000   '  Browsing is disallowed for this file or section
    %SP_COPY_NEWER_ONLY          = &H0010000   '  copy only if source file newer than target
    %SP_COPY_SOURCE_SIS_MASTER   = &H0020000   '  source is single-instance store master
    %SP_COPY_OEMINF_CATALOG_ONLY  =&H0040000   '  (SetupCopyOEMInf only) don't copy INF--just catalog
    %SP_COPY_REPLACE_BOOT_FILE   = &H0080000   '  file must be present upon reboot (i.e., it's
    '  needed by the loader); this flag implies a reboot
    %SP_COPY_NOPRUNE             = &H0100000   '  never prune this file
    
    #IF %SETUPAPI_VER >= &H0501
    
    %SP_COPY_OEM_F6_INF          = &H0200000   '  Used when calling SetupCopyOemInf
    
    #ENDIF ' %SETUPAPI_VER >= &H0501
    
    #IF %SETUPAPI_VER >= &H0501
    
    
    '  Flags passed to Backup notification
    
    %SP_BACKUP_BACKUPPASS        = &H00000001  '  file backed up during backup pass
    %SP_BACKUP_DEMANDPASS        = &H00000002  '  file backed up on demand
    %SP_BACKUP_SPECIAL           = &H00000004  '  if set, special type of backup
    %SP_BACKUP_BOOTFILE          = &H00000008  '  file marked with COPYFLG_REPLACE_BOOT_FILE
    
    
    #ENDIF ' %SETUPAPI_VER >= &H0501
    
    
    '  Define flags for SetupScanFileQueue.
    
    %SPQ_SCAN_FILE_PRESENCE                  = &H00000001
    %SPQ_SCAN_FILE_VALIDITY                  = &H00000002
    %SPQ_SCAN_USE_CALLBACK                   = &H00000004
    %SPQ_SCAN_USE_CALLBACKEX                 = &H00000008
    %SPQ_SCAN_INFORM_USER                    = &H00000010
    %SPQ_SCAN_PRUNE_COPY_QUEUE               = &H00000020
    
    #IF %SETUPAPI_VER >= &H0501
    
    %SPQ_SCAN_USE_CALLBACK_SIGNERINFO        = &H00000040
    %SPQ_SCAN_PRUNE_DELREN                   = &H00000080 '  remote Delete/Rename queue
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Define flags used with Param2 for SPFILENOTIFY_QUEUESCAN
    
    %SPQ_DELAYED_COPY                        = &H00000001  '  file was in use; registered for delayed copy
    
    #IF %SETUPAPI_VER >= &H0501
    
    
    '  Flags/FlagMask for use with SetupSetFileQueueFlags and returned by SetupGetFileQueueFlags
    
    %SPQ_FLAG_BACKUP_AWARE      = &H00000001  '  If set, SetupCommitFileQueue will
    '  issue backup notifications.
    
    %SPQ_FLAG_ABORT_IF_UNSIGNED  =&H00000002  '  If set, SetupCommitFileQueue will
    '  fail with ERROR_SET_SYSTEM_RESTORE_POINT
    '  if the user elects to proceed with an
    '  unsigned queue committal.  This allows
    '  the caller to set a system restore point,
    '  then re-commit the file queue.
    
    %SPQ_FLAG_FILES_MODIFIED    = &H00000004  '  If set, at least one file was
    '  replaced by a different version
    
    %SPQ_FLAG_VALID             = &H00000007  '  mask of valid flags (can be passed as FlagMask)
    
    #ENDIF  '  %SETUPAPI_VER >= &H0501
    
    
    '  Define OEM Source Type values for use in SetupCopyOEMInf.
    
    %SPOST_NONE  = 0
    %SPOST_PATH  = 1
    %SPOST_URL   = 2
    %SPOST_MAX   = 3
    
    
    #IF %SETUPAPI_VER >= &H0501
    
    
    '  Flags used by SetupUninstallOEMInf
    
    %SUOI_FORCEDELETE   = &H00000001
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Flags for SetupCreateDiskSpaceList
    
    %SPDSL_IGNORE_DISK              = &H00000001  '  ignore deletes and on-disk files in copies
    %SPDSL_DISALLOW_NEGATIVE_ADJUST  =&H00000002
    
    
    '  Define flags that are returned by SetupPromptReboot
    
    %SPFILEQ_FILE_IN_USE         = &H00000001
    %SPFILEQ_REBOOT_RECOMMENDED  = &H00000002
    %SPFILEQ_REBOOT_IN_PROGRESS  = &H00000004
    
    
    '  Flags for AddReg section lines in INF.  The corresponding value
    '  is <ValueType> in the AddReg line format given below:
    
    '  <RegRootString>,<SubKey>,<ValueName>,<ValueType>,<Value>...
    
    '  The low word contains basic flags concerning the general data type
    '  and AddReg action. The high word contains values that more specifically
    '  identify the data type of the registry value.  The high word is ignored
    '  by the 16-bit Windows 95 SETUPX APIs.
    
    '  If <ValueType> has FLG_ADDREG_DELREG_BIT set, it will be ignored by AddReg
    '  (not supported by SetupX).
    
    
    #IF %SETUPAPI_VER >= &H0501
    
    %FLG_ADDREG_DELREG_BIT       = ( &H00008000 ) '  if set, interpret as DELREG, see below
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    %FLG_ADDREG_BINVALUETYPE     = ( &H00000001 )
    %FLG_ADDREG_NOCLOBBER        = ( &H00000002 )
    %FLG_ADDREG_DELVAL           = ( &H00000004 )
    %FLG_ADDREG_APPEND           = ( &H00000008 ) '  Currently supported only
    '  for REG_MULTI_SZ values.
    %FLG_ADDREG_KEYONLY          = ( &H00000010 ) '  Just create the key, ignore value
    %FLG_ADDREG_OVERWRITEONLY    = ( &H00000020 ) '  Set only if value already exists
    
    #IF %SETUPAPI_VER >= &H0501
    
    %FLG_ADDREG_64BITKEY         = ( &H00001000 ) '  make this change in the 64 bit registry.
    %FLG_ADDREG_KEYONLY_COMMON   = ( &H00002000 ) '  same as FLG_ADDREG_KEYONLY but also works for DELREG
    %FLG_ADDREG_32BITKEY         = ( &H00004000 ) '  make this change in the 32 bit registry.
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  The INF may supply any arbitrary data type ordinal in the highword except
    '  for the following: REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ.  If this
    '  technique is used, then the data is given in binary format, one byte per
    '  field.
    
    %FLG_ADDREG_TYPE_MASK        = ( &HFFFF0000 OR %FLG_ADDREG_BINVALUETYPE )
    %FLG_ADDREG_TYPE_SZ          = ( &H00000000                           )
    %FLG_ADDREG_TYPE_MULTI_SZ    = ( &H00010000                           )
    %FLG_ADDREG_TYPE_EXPAND_SZ   = ( &H00020000                           )
    %FLG_ADDREG_TYPE_BINARY      = ( &H00000000 OR %FLG_ADDREG_BINVALUETYPE )
    %FLG_ADDREG_TYPE_DWORD       = ( &H00010000 OR %FLG_ADDREG_BINVALUETYPE )
    %FLG_ADDREG_TYPE_NONE        = ( &H00020000 OR %FLG_ADDREG_BINVALUETYPE )
    
    
    '  Flags for DelReg section lines in INF.  The corresponding value
    '  is <Operation> in the extended DelReg line format given below:
    
    '  <RegRootString>,<SubKey>,<ValueName>,<Operation>[,...]
    
    '  In SetupX and some versions of SetupAPI, <Operation> will be ignored and <ValueName> will
    '  be deleted. Use with care.
    
    '  The bits determined by mask FLG_DELREG_TYPE_MASK indicates type of data expected.
    '  <Operation> must have FLG_ADDREG_DELREG_BIT set, otherwise it is ignored and specified
    '  value will be deleted (allowing an AddReg section to also be used as a DelReg section)
    '  if <Operation> is not specified, <ValueName> will be deleted (if specified) otherwise
    '  <SubKey> will be deleted.
    
    '  the compatability flag
    
    %FLG_DELREG_VALUE            = (&H00000000)
    
    #IF %SETUPAPI_VER >= &H0501
    
    %FLG_DELREG_TYPE_MASK        = %FLG_ADDREG_TYPE_MASK        '  &HFFFF0001
    %FLG_DELREG_TYPE_SZ          = %FLG_ADDREG_TYPE_SZ          '  &H00000000
    %FLG_DELREG_TYPE_MULTI_SZ    = %FLG_ADDREG_TYPE_MULTI_SZ    '  &H00010000
    %FLG_DELREG_TYPE_EXPAND_SZ   = %FLG_ADDREG_TYPE_EXPAND_SZ   '  &H00020000
    %FLG_DELREG_TYPE_BINARY      = %FLG_ADDREG_TYPE_BINARY      '  &H00000001
    %FLG_DELREG_TYPE_DWORD       = %FLG_ADDREG_TYPE_DWORD       '  &H00010001
    %FLG_DELREG_TYPE_NONE        = %FLG_ADDREG_TYPE_NONE        '  &H00020001
    %FLG_DELREG_64BITKEY         = %FLG_ADDREG_64BITKEY         '  &H00001000
    %FLG_DELREG_KEYONLY_COMMON   = %FLG_ADDREG_KEYONLY_COMMON   '  &H00002000
    %FLG_DELREG_32BITKEY         = %FLG_ADDREG_32BITKEY         '  &H00004000
    
    
    '  <Operation> = FLG_DELREG_MULTI_SZ_DELSTRING
    '                <RegRootString>,<SubKey>,<ValueName>,&H00018002,<String>
    '                removes all entries matching <String> (case ignored) from multi-sz registry value
    
    
    %FLG_DELREG_OPERATION_MASK   = (&H000000FE)
    %FLG_DELREG_MULTI_SZ_DELSTRING ( = %FLG_DELREG_TYPE_MULTI_SZ OR %FLG_ADDREG_DELREG_BIT OR &H00000002 ) '  &H00018002
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Flags for BitReg section lines in INF.
    
    %FLG_BITREG_CLEARBITS        = ( &H00000000 )
    %FLG_BITREG_SETBITS          = ( &H00000001 )
    
    #IF %SETUPAPI_VER >= &H0501
    
    %FLG_BITREG_64BITKEY         = ( &H00001000 )
    %FLG_BITREG_32BITKEY         = ( &H00004000 )
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Flags for Ini2Reg section lines in INF.
    
    #IF %SETUPAPI_VER >= &H0501
    
    %FLG_INI2REG_64BITKEY        = ( &H00001000 )
    %FLG_INI2REG_32BITKEY        = ( &H00004000 )
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Flags for RegSvr section lines in INF
    
    %FLG_REGSVR_DLLREGISTER      = ( &H00000001 )
    %FLG_REGSVR_DLLINSTALL       = ( &H00000002 )
    
    
    '  Flags for RegSvr section lines in INF
    
    %FLG_PROFITEM_CURRENTUSER    = ( &H00000001 )
    %FLG_PROFITEM_DELETE         = ( &H00000002 )
    %FLG_PROFITEM_GROUP          = ( &H00000004 )
    %FLG_PROFITEM_CSIDL          = ( &H00000008 )
    
    
    '  Flags for SetupInstallFromInfSection
    
    %SPINST_LOGCONFIG                = &H00000001
    %SPINST_INIFILES                 = &H00000002
    %SPINST_REGISTRY                 = &H00000004
    %SPINST_INI2REG                  = &H00000008
    %SPINST_FILES                    = &H00000010
    %SPINST_BITREG                   = &H00000020
    %SPINST_REGSVR                   = &H00000040
    %SPINST_UNREGSVR                 = &H00000080
    %SPINST_PROFILEITEMS             = &H00000100
    
    #IF %SETUPAPI_VER >= &H0501
    
    %SPINST_COPYINF                  = &H00000200
    %SPINST_ALL                      = &H000003ff
    
    #ELSE
    
    %SPINST_ALL                      = &H000001ff
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    %SPINST_SINGLESECTION            = &H00010000
    %SPINST_LOGCONFIG_IS_FORCED      = &H00020000
    %SPINST_LOGCONFIGS_ARE_OVERRIDES  =&H00040000
    
    #IF %SETUPAPI_VER >= &H0501
    
    %SPINST_REGISTERCALLBACKAWARE    = &H00080000
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Flags for SetupInstallServicesFromInfSection(Ex).  These flags are also used
    '  in the flags field of AddService or DelService lines in a device INF.  Some
    '  of these flags are not permitted in the non-Ex API.  These flags are marked
    '  as such below.
    
    
    
    '  (AddService) move service's tag to front of its group order list
    
    %SPSVCINST_TAGTOFRONT               = (&H00000001)
    
    
    '  (AddService) **Ex API only** mark this service as the function driver for the
    '  device being installed
    
    %SPSVCINST_ASSOCSERVICE             = (&H00000002)
    
    
    '  (DelService) delete the associated event log entry for a service specified in
    '  a DelService entry
    
    %SPSVCINST_DELETEEVENTLOGENTRY      = (&H00000004)
    
    
    '  (AddService) don't overwrite display name if it already exists
    
    %SPSVCINST_NOCLOBBER_DISPLAYNAME    = (&H00000008)
    
    
    '  (AddService) don't overwrite start type value if service already exists
    
    %SPSVCINST_NOCLOBBER_STARTTYPE      = (&H00000010)
    
    
    '  (AddService) don't overwrite error control value if service already exists
    
    %SPSVCINST_NOCLOBBER_ERRORCONTROL   = (&H00000020)
    
    
    '  (AddService) don't overwrite load order group if it already exists
    
    %SPSVCINST_NOCLOBBER_LOADORDERGROUP  =(&H00000040)
    
    
    '  (AddService) don't overwrite dependencies list if it already exists
    
    %SPSVCINST_NOCLOBBER_DEPENDENCIES   = (&H00000080)
    
    
    '  (AddService) don't overwrite description if it already exists
    
    %SPSVCINST_NOCLOBBER_DESCRIPTION    = (&H00000100)
    
    '  (DelService) stop the associated service specified in
    '  a DelService entry before deleting the service
    
    %SPSVCINST_STOPSERVICE              = (&H00000200)
    
    #IF %SETUPAPI_VER >= &H0501
    
    '  (AddService) force overwrite of security settings
    
    %SPSVCINST_CLOBBER_SECURITY         = (&H00000400)
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Define handle type for Setup file log.
    
    MACRO HSPFILELOG = DWORD
    
    
    '  Flags for SetupInitializeFileLog
    
    %SPFILELOG_SYSTEMLOG     = &H00000001  '  use system log -- must be Administrator
    %SPFILELOG_FORCENEW      = &H00000002  '  not valid with SPFILELOG_SYSTEMLOG
    %SPFILELOG_QUERYONLY     = &H00000004  '  allows non-administrators to read system log
    
    
    '  Flags for SetupLogFile
    
    %SPFILELOG_OEMFILE   = &H00000001
    
    
    '  Items retrievable from SetupQueryFileLog()
    
    MACRO SetupFileLogSourceFilename        = 0
    MACRO SetupFileLogChecksum              = 1
    MACRO SetupFileLogDiskTagfile           = 2
    MACRO SetupFileLogDiskDescription       = 3
    MACRO SetupFileLogOtherInfo             = 4
    MACRO SetupFileLogMax                   = 5
    
    
    '  Text logging APIs
    
    MACRO LogSeverity            = DWORD
    %LogSevInformation           = &H00000000
    %LogSevWarning               = &H00000001
    %LogSevError                 = &H00000002
    %LogSevFatalError            = &H00000003
    %LogSevMaximum               = &H00000004
    
    
    '  Flags for SetupDiCreateDeviceInfo
    
    %DICD_GENERATE_ID        = &H00000001
    %DICD_INHERIT_CLASSDRVS  = &H00000002
    
    
    '  Flags for SetupDiOpenDeviceInfo
    
    %DIOD_INHERIT_CLASSDRVS  = &H00000002
    %DIOD_CANCEL_REMOVE      = &H00000004
    
    
    '  Flags for SetupDiOpenDeviceInterface
    
    %DIODI_NO_ADD    = &H00000001
    
    
    '  Flags for SetupDiRegisterDeviceInfo
    
    %SPRDI_FIND_DUPS        = &H00000001
    
    
    '  Ordinal values distinguishing between class drivers and
    '  device drivers.
    '  (Passed in 'DriverType' parameter of driver information list APIs)
    
    %SPDIT_NODRIVER           = &H00000000
    %SPDIT_CLASSDRIVER        = &H00000001
    %SPDIT_COMPATDRIVER       = &H00000002
    
    
    '  Flags controlling what is included in the device information set built
    '  by SetupDiGetClassDevs
    
    %DIGCF_DEFAULT           = &H00000001  '  only valid with DIGCF_DEVICEINTERFACE
    %DIGCF_PRESENT           = &H00000002
    %DIGCF_ALLCLASSES        = &H00000004
    %DIGCF_PROFILE           = &H00000008
    %DIGCF_DEVICEINTERFACE   = &H00000010
    
    
    '  Backward compatibility--do not use.
    
    %DIGCF_INTERFACEDEVICE  =%DIGCF_DEVICEINTERFACE
    
    
    '  Flags controlling exclusion from the class information list built
    '  by SetupDiBuildClassInfoList(Ex)
    
    %DIBCI_NOINSTALLCLASS   = &H00000001
    %DIBCI_NODISPLAYCLASS   = &H00000002
    
    
    '  KeyType values for SetupDiCreateDevRegKey, SetupDiOpenDevRegKey, and
    '  SetupDiDeleteDevRegKey.
    
    %DIREG_DEV       = &H00000001          '  Open/Create/Delete device key
    %DIREG_DRV       = &H00000002          '  Open/Create/Delete driver key
    %DIREG_BOTH      = &H00000004          '  Delete both driver and Device key
    
    
    '  Device registry property codes
    '  (Codes marked as read-only (R) may only be used for
    '  SetupDiGetDeviceRegistryProperty)
    
    '  These values should cover the same set of registry properties
    '  as defined by the CM_DRP codes in cfgmgr32.h.
    
    '  Note that SPDRP codes are zero based while CM_DRP codes are one based!
    
    %SPDRP_DEVICEDESC                  = (&H00000000)  '  DeviceDesc (R/W)
    %SPDRP_HARDWAREID                  = (&H00000001)  '  HardwareID (R/W)
    %SPDRP_COMPATIBLEIDS               = (&H00000002)  '  CompatibleIDs (R/W)
    %SPDRP_UNUSED0                     = (&H00000003)  '  unused
    %SPDRP_SERVICE                     = (&H00000004)  '  Service (R/W)
    %SPDRP_UNUSED1                     = (&H00000005)  '  unused
    %SPDRP_UNUSED2                     = (&H00000006)  '  unused
    %SPDRP_CLASS                       = (&H00000007)  '  Class (R--tied to ClassGUID)
    %SPDRP_CLASSGUID                   = (&H00000008)  '  ClassGUID (R/W)
    %SPDRP_DRIVER                      = (&H00000009)  '  Driver (R/W)
    %SPDRP_CONFIGFLAGS                 = (&H0000000A)  '  ConfigFlags (R/W)
    %SPDRP_MFG                         = (&H0000000B)  '  Mfg (R/W)
    %SPDRP_FRIENDLYNAME                = (&H0000000C)  '  FriendlyName (R/W)
    %SPDRP_LOCATION_INFORMATION        = (&H0000000D)  '  LocationInformation (R/W)
    %SPDRP_PHYSICAL_DEVICE_OBJECT_NAME  =(&H0000000E)  '  PhysicalDeviceObjectName (R)
    %SPDRP_CAPABILITIES                = (&H0000000F)  '  Capabilities (R)
    %SPDRP_UI_NUMBER                   = (&H00000010)  '  UiNumber (R)
    %SPDRP_UPPERFILTERS                = (&H00000011)  '  UpperFilters (R/W)
    %SPDRP_LOWERFILTERS                = (&H00000012)  '  LowerFilters (R/W)
    %SPDRP_BUSTYPEGUID                 = (&H00000013)  '  BusTypeGUID (R)
    %SPDRP_LEGACYBUSTYPE               = (&H00000014)  '  LegacyBusType (R)
    %SPDRP_BUSNUMBER                   = (&H00000015)  '  BusNumber (R)
    %SPDRP_ENUMERATOR_NAME             = (&H00000016)  '  Enumerator Name (R)
    %SPDRP_SECURITY                    = (&H00000017)  '  Security (R/W, binary form)
    %SPDRP_SECURITY_SDS                = (&H00000018)  '  Security (W, SDS form)
    %SPDRP_DEVTYPE                     = (&H00000019)  '  Device Type (R/W)
    %SPDRP_EXCLUSIVE                   = (&H0000001A)  '  Device is exclusive-access (R/W)
    %SPDRP_CHARACTERISTICS             = (&H0000001B)  '  Device Characteristics (R/W)
    %SPDRP_ADDRESS                     = (&H0000001C)  '  Device Address (R)
    %SPDRP_UI_NUMBER_DESC_FORMAT       = (&H0000001D)  '  UiNumberDescFormat (R/W)
    %SPDRP_DEVICE_POWER_DATA           = (&H0000001E)  '  Device Power Data (R)
    %SPDRP_REMOVAL_POLICY              = (&H0000001F)  '  Removal Policy (R)
    %SPDRP_REMOVAL_POLICY_HW_DEFAULT   = (&H00000020)  '  Hardware Removal Policy (R)
    %SPDRP_REMOVAL_POLICY_OVERRIDE     = (&H00000021)  '  Removal Policy Override (RW)
    %SPDRP_INSTALL_STATE               = (&H00000022)  '  Device Install State (R)
    %SPDRP_LOCATION_PATHS              = (&H00000023)  '  Device Location Paths (R)
    
    %SPDRP_MAXIMUM_PROPERTY            = (&H00000024)  '  Upper bound on ordinals
    
    
    '  Class registry property codes
    '  (Codes marked as read-only (R) may only be used for
    '  SetupDiGetClassRegistryProperty)
    
    '  These values should cover the same set of registry properties
    '  as defined by the CM_CRP codes in cfgmgr32.h.
    '  they should also have a 1:1 correspondence with Device registers, where applicable
    '  but no overlap otherwise
    
    %SPCRP_SECURITY                    = (&H00000017)  '  Security (R/W, binary form)
    %SPCRP_SECURITY_SDS                = (&H00000018)  '  Security (W, SDS form)
    %SPCRP_DEVTYPE                     = (&H00000019)  '  Device Type (R/W)
    %SPCRP_EXCLUSIVE                   = (&H0000001A)  '  Device is exclusive-access (R/W)
    %SPCRP_CHARACTERISTICS             = (&H0000001B)  '  Device Characteristics (R/W)
    %SPCRP_MAXIMUM_PROPERTY            = (&H0000001C)  '  Upper bound on ordinals
    
    
    '  Flags controlling the drawing of mini-icons
    
    %DMI_MASK      = &H00000001
    %DMI_BKCOLOR   = &H00000002
    %DMI_USERECT   = &H00000004
    
    
    '  PropertySheetType values for the SetupDiGetClassDevPropertySheets API
    
    %DIGCDP_FLAG_BASIC           = &H00000001
    %DIGCDP_FLAG_ADVANCED        = &H00000002
    
    #IF %SETUPAPI_VER >= &H0501
    
    %DIGCDP_FLAG_REMOTE_BASIC    = &H00000003  '  not presently implemented
    %DIGCDP_FLAG_REMOTE_ADVANCED  =&H00000004
    
    #ENDIF '  %SETUPAPI_VER >= &H0501
    
    
    '  Define ICON IDs publicly exposed from setupapi.
    
    %IDI_RESOURCEFIRST           = 159
    %IDI_RESOURCE                = 159
    %IDI_RESOURCELAST            = 161
    %IDI_RESOURCEOVERLAYFIRST    = 161
    %IDI_RESOURCEOVERLAYLAST     = 161
    %IDI_CONFLICT                = 161
    
    %IDI_CLASSICON_OVERLAYFIRST  = 500
    %IDI_CLASSICON_OVERLAYLAST   = 502
    %IDI_PROBLEM_OVL             = 500
    %IDI_DISABLED_OVL            = 501
    %IDI_FORCED_OVL              = 502
    
    
    
    '  PageType values for SetupDiGetWizardPage API
    
    %SPWPT_SELECTDEVICE      = &H00000001
    
    
    '  Flags for SetupDiGetWizardPage API
    
    %SPWP_USE_DEVINFO_DATA   = &H00000001
    
    
    
    '  SetupEnumInfSections is for low-level parsing of an INF
    
    TYPE SP_INF_SIGNER_INFO_A
         cbSize AS DWORD
         CatalogFile AS ASCIIZ * %MAX_PATH
         DigitalSigner AS ASCIIZ * %MAX_PATH
         DigitalSignerVersion AS ASCIIZ * %MAX_PATH
    END TYPE
    
    TYPE SP_INF_SIGNER_INFO_W
         cbSize AS DWORD
         CatalogFile AS STRING * %MAX_PATH * 2
         DigitalSigner AS STRING * %MAX_PATH * 2
         DigitalSignerVersion AS STRING * %MAX_PATH * 2
    END TYPE
    
    #IF %DEF(%UNICODE)
        MACRO SP_INF_SIGNER_INFO = SP_INF_SIGNER_INFO_W
    #ELSE
        MACRO SP_INF_SIGNER_INFO = PSP_INF_SIGNER_INFO_A
    #ENDIF
    
    
    #IF %SETUPAPI_VER >= &H0501
    
    '  Flags for use by SetupDiGetCustomDeviceProperty
    
    %DICUSTOMDEVPROP_MERGE_MULTISZ    = &H00000001
    
    #ENDIF ' %SETUPAPI_VER >= &H0501
    
    
    
    #IF %SETUPAPI_VER >= &H0502
    
    '  To configure WMI security for downlevel platforms where the [DDInstall.WMI]
    '  section isn't natively supported by setupapi, a redistributable co-installer
    '  is supplied in the DDK for use on those platforms.
    
    
    
    '  Flags for use by SetupConfigureWmiFromInfSection
    
    %SCWMI_CLOBBER_SECURITY  = &H00000001
    
    #ENDIF ' %SETUPAPI_VER >= &H0502
    
    
    
    
    
    #IF %DEF(%UNICODE) ' UNICODE specific functions...
    
    DECLARE FUNCTION SetupGetInfInformationW LIB "SETUPAPI.DLL" ALIAS "SetupGetInfInformationW" (BYREF InfSpec AS ANY, _
                                                                                                 BYVAL SearchControl AS DWORD, _
                                                                                                 BYREF ReturnBuffer AS SP_INF_INFORMATION, _
                                                                                                 BYVAL ReturnBufferSize AS DWORD, _
                                                                                                 BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetInfInformation(InfSpec, SearchControl, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetInfInformationW(InfSpec, SearchControl, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQueryInfFileInformationW LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfFileInformationW" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                             BYVAL InfIndex AS DWORD, _
                                                                                                             BYREF ReturnBuffer AS ANY, _
                                                                                                             BYVAL ReturnBufferSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryInfFileInformation(InfInformation, InfIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryInfFileInformationW(InfInformation, InfIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQueryInfOriginalFileInformationW LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfOriginalFileInformationW" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                                             BYVAL InfIndex AS DWORD, _
                                                                                                                             BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                             BYREF OriginalFileInfo AS SP_ORIGINAL_FILE_INFO_W) AS LONG
    MACRO SetupQueryInfOriginalFileInformation(InfInformation, InfIndex, AlternatePlatformInfo, OriginalFileInfo) = SetupQueryInfOriginalFileInformationW(InfInformation, InfIndex, AlternatePlatformInfo, OriginalFileInfo)
    
    DECLARE FUNCTION SetupQueryInfVersionInformationW LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfVersionInformationW" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                                   BYVAL InfIndex AS DWORD, _
                                                                                                                   BYREF Key AS ANY, _
                                                                                                                   BYREF ReturnBuffer AS ANY, _
                                                                                                                   BYVAL ReturnBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryInfVersionInformation(InfInformation, InfIndex, Key, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryInfVersionInformationW(InfInformation, InfIndex, Key, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetInfFileListW LIB "SETUPAPI.DLL" ALIAS "SetupGetInfFileListW" (BYREF DirectoryPath AS ANY, _
                                                                                           BYVAL InfStyle AS DWORD, _
                                                                                           BYREF ReturnBuffer AS ANY, _
                                                                                           BYVAL ReturnBufferSize AS DWORD, _
                                                                                           BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetInfFileList(DirectoryPath, InfStyle, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetInfFileListW(DirectoryPath, InfStyle, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupOpenInfFileW LIB "SETUPAPI.DLL" ALIAS "SetupOpenInfFileW" (BYREF FileName AS ANY, _
                                                                                     BYREF InfClass AS ANY, _
                                                                                     BYVAL InfStyle AS DWORD, _
                                                                                     BYREF ErrorLine AS DWORD) AS HINF
    MACRO SetupOpenInfFile(FileName, InfClass, InfStyle, ErrorLine) = SetupOpenInfFileW(FileName, InfClass, InfStyle, ErrorLine)
    
    DECLARE FUNCTION SetupOpenAppendInfFileW LIB "SETUPAPI.DLL" ALIAS "SetupOpenAppendInfFileW" (BYREF FileName AS ANY, _
                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                 BYREF ErrorLine AS DWORD) AS LONG
    MACRO SetupOpenAppendInfFile(FileName, InfHandle, ErrorLine) = SetupOpenAppendInfFileW(FileName, InfHandle, ErrorLine)
    
    DECLARE FUNCTION SetupFindFirstLineW LIB "SETUPAPI.DLL" ALIAS "SetupFindFirstLineW" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF Section AS ANY, _
                                                                                         BYREF Key AS ANY, _
                                                                                         BYREF inContext AS INFCONTEXT) AS LONG
    MACRO SetupFindFirstLine(InfHandle, Section, Key, inContext) = SetupFindFirstLineW(InfHandle, Section, Key, inContext)
    
    DECLARE FUNCTION SetupFindNextMatchLineW LIB "SETUPAPI.DLL" ALIAS "SetupFindNextMatchLineW" (BYREF ContextIn AS INFCONTEXT, _
                                                                                                 BYREF Key AS ANY, _
                                                                                                 BYREF ContextOut AS INFCONTEXT) AS LONG
    MACRO SetupFindNextMatchLine(ContextIn, Key, ContextOut) = SetupFindNextMatchLineW(ContextIn, Key, ContextOut)
    
    DECLARE FUNCTION SetupGetLineByIndexW LIB "SETUPAPI.DLL" ALIAS "SetupGetLineByIndexW" (BYVAL InfHandle AS HINF, _
                                                                                           BYREF Section AS ANY, _
                                                                                           BYVAL Index AS DWORD, _
                                                                                           BYREF inContext AS INFCONTEXT) AS LONG
    MACRO SetupGetLineByIndex(InfHandle, Section, Index, inContext) = SetupGetLineByIndexW(InfHandle, Section, Index, inContext)
    
    DECLARE FUNCTION SetupGetLineCountW LIB "SETUPAPI.DLL" ALIAS "SetupGetLineCountW" (BYVAL InfHandle AS HINF, _
                                                                                       BYREF Section AS ANY) AS LONG
    MACRO SetupGetLineCount(InfHandle, Section) = SetupGetLineCountW(InfHandle, Section)
    
    DECLARE FUNCTION SetupGetLineTextW LIB "SETUPAPI.DLL" ALIAS "SetupGetLineTextW" (BYREF inContext AS INFCONTEXT, _
                                                                                     BYVAL InfHandle AS HINF, _
                                                                                     BYREF Section AS ANY, _
                                                                                     BYREF Key AS ANY, _
                                                                                     BYREF ReturnBuffer AS ANY, _
                                                                                     BYVAL ReturnBufferSize AS DWORD, _
                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetLineText(inContext, InfHandle, Section, Key, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetLineTextW(inContext, InfHandle, Section, Key, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetStringFieldW LIB "SETUPAPI.DLL" ALIAS "SetupGetStringFieldW" (BYREF inContext AS INFCONTEXT, _
                                                                                           BYVAL FieldIndex AS DWORD, _
                                                                                           BYREF ReturnBuffer AS ANY, _
                                                                                           BYVAL ReturnBufferSize AS DWORD, _
                                                                                           BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetStringField(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetStringFieldW(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetMultiSzFieldW LIB "SETUPAPI.DLL" ALIAS "SetupGetMultiSzFieldW" (BYREF inContext AS INFCONTEXT, _
                                                                                             BYVAL FieldIndex AS DWORD, _
                                                                                             BYREF ReturnBuffer AS ANY, _
                                                                                             BYVAL ReturnBufferSize AS DWORD, _
                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetMultiSzField(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetMultiSzFieldW(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetFileCompressionInfoW LIB "SETUPAPI.DLL" ALIAS "SetupGetFileCompressionInfoW" (BYREF SourceFileName AS ANY, _
                                                                                                           BYREF ActualSourceFileName AS ANY, _
                                                                                                           BYREF SourceFileSize AS DWORD, _
                                                                                                           BYREF TargetFileSize AS DWORD, _
                                                                                                           BYREF CompressionType AS DWORD) AS DWORD
    MACRO SetupGetFileCompressionInfo(SourceFileName, ActualSourceFileName, SourceFileSize, TargetFileSize, CompressionType) = SetupGetFileCompressionInfoW(SourceFileName, ActualSourceFileName, SourceFileSize, TargetFileSize, CompressionType)
    
    DECLARE FUNCTION SetupGetFileCompressionInfoExW LIB "SETUPAPI.DLL" ALIAS "SetupGetFileCompressionInfoExW" (BYREF SourceFileName AS ANY, _
                                                                                                               BYREF ActualSourceFileNameBuffer AS ANY, _
                                                                                                               BYVAL ActualSourceFileNameBufferLen AS DWORD, _
                                                                                                               BYREF RequiredBufferLen AS DWORD, _
                                                                                                               BYREF SourceFileSize AS DWORD, _
                                                                                                               BYREF TargetFileSize AS DWORD, _
                                                                                                               BYREF CompressionType AS DWORD) AS LONG
    MACRO SetupGetFileCompressionInfoEx(SourceFileName, ActualSourceFileNameBuffer, ActualSourceFileNameBufferLen, RequiredBufferLen, SourceFileSize, TargetFileSize, CompressionType) = _
    SetupGetFileCompressionInfoExW(SourceFileName, ActualSourceFileNameBuffer, ActualSourceFileNameBufferLen, RequiredBufferLen, SourceFileSize, TargetFileSize, CompressionType)
    
    DECLARE FUNCTION SetupDecompressOrCopyFileW LIB "SETUPAPI.DLL" ALIAS "SetupDecompressOrCopyFileW" (BYREF SourceFileName AS ANY, _
                                                                                                       BYREF TargetFileName AS ANY, _
                                                                                                       BYREF CompressionType AS DWORD) AS DWORD
    MACRO SetupDecompressOrCopyFile(SourceFileName, TargetFileName, CompressionType) = SetupDecompressOrCopyFileW(SourceFileName, TargetFileName, CompressionType)
    
    DECLARE FUNCTION SetupGetSourceFileLocationW LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceFileLocationW" (BYVAL InfHandle AS HINF, _
                                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                                         BYREF FileName AS ANY, _
                                                                                                         BYREF SourceId AS DWORD, _
                                                                                                         BYREF ReturnBuffer AS ANY, _
                                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetSourceFileLocation(InfHandle, inContext, FileName, SourceId, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetSourceFileLocationW(InfHandle, inContext, FileName, SourceId, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetSourceFileSizeW LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceFileSizeW" (BYVAL InfHandle AS HINF, _
                                                                                                 BYREF inContext AS INFCONTEXT, _
                                                                                                 BYREF FileName AS ANY, _
                                                                                                 BYREF Section AS ANY, _
                                                                                                 BYREF FileSize AS DWORD, _
                                                                                                 BYVAL RoundingFactor AS DWORD) AS LONG
    MACRO SetupGetSourceFileSize(InfHandle, inContext, FileName, Section, FileSize, RoundingFactor) = SetupGetSourceFileSizeW(InfHandle, inContext, FileName, Section, FileSize, RoundingFactor)
    
    DECLARE FUNCTION SetupGetTargetPathW LIB "SETUPAPI.DLL" ALIAS "SetupGetTargetPathW" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                         BYREF Section AS ANY, _
                                                                                         BYREF ReturnBuffer AS ANY, _
                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetTargetPath(InfHandle, inContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetTargetPathW(InfHandle, inContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupSetSourceListW LIB "SETUPAPI.DLL" ALIAS "SetupSetSourceListW" (BYVAL Flags AS DWORD, _
                                                                                         BYREF SourceList AS ANY, _
                                                                                         BYVAL SourceCount AS DWORD) AS LONG
    MACRO SetupSetSourceList(Flags, SourceList, SourceCount) = SetupSetSourceListW(Flags, SourceList, SourceCount)
    
    DECLARE FUNCTION SetupAddToSourceListW LIB "SETUPAPI.DLL" ALIAS "SetupAddToSourceListW" (BYVAL Flags AS DWORD, _
                                                                                             BYREF Source AS ANY) AS LONG
    MACRO SetupAddToSourceList(Flags, Source) = SetupAddToSourceListW(Flags, Source)
    
    DECLARE FUNCTION SetupRemoveFromSourceListW LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFromSourceListW" (BYVAL Flags AS DWORD, _
                                                                                                       BYREF Source AS ANY) AS LONG
    MACRO SetupRemoveFromSourceList(Flags, Source) = SetupRemoveFromSourceListW(Flags, Source)
    
    DECLARE FUNCTION SetupQuerySourceListW LIB "SETUPAPI.DLL" ALIAS "SetupQuerySourceListW" (BYVAL Flags AS DWORD, _
                                                                                             BYREF List AS ANY, _
                                                                                             BYREF Count AS DWORD) AS LONG
    MACRO SetupQuerySourceList(Flags, List, Count) = SetupQuerySourceListW(Flags, List, Count)
    
    DECLARE FUNCTION SetupFreeSourceListW LIB "SETUPAPI.DLL" ALIAS "SetupFreeSourceListW" (BYREF List AS ANY, _
                                                                                           BYVAL Count AS DWORD) AS LONG
    MACRO SetupFreeSourceList(List, Count) = SetupFreeSourceListW(List, Count)
    
    DECLARE FUNCTION SetupPromptForDiskW LIB "SETUPAPI.DLL" ALIAS "SetupPromptForDiskW" (BYVAL hwndParent AS DWORD, _
                                                                                         BYREF DialogTitle AS ANY, _
                                                                                         BYREF DiskName AS ANY, _
                                                                                         BYREF PathToSource AS ANY, _
                                                                                         BYREF FileSought AS ANY, _
                                                                                         BYREF TagFile AS ANY, _
                                                                                         BYVAL DiskPromptStyle AS DWORD, _
                                                                                         BYREF PathBuffer AS ANY, _
                                                                                         BYVAL PathBufferSize AS DWORD, _
                                                                                         BYREF PathRequiredSize AS DWORD) AS DWORD
    MACRO SetupPromptForDisk(hwndParent, DialogTitle, DiskName, PathToSource, FileSought, TagFile, DiskPromptStyle, PathBuffer, PathBufferSize, PathRequiredSize) = _
    SetupPromptForDiskW(hwndParent, DialogTitle, DiskName, PathToSource, FileSought, TagFile, DiskPromptStyle, PathBuffer, PathBufferSize, PathRequiredSize)
    
    DECLARE FUNCTION SetupCopyErrorW LIB "SETUPAPI.DLL" ALIAS "SetupCopyErrorW" (BYVAL hwndParent AS DWORD, _
                                                                                 BYREF DialogTitle AS ANY, _
                                                                                 BYREF DiskName AS ANY, _
                                                                                 BYREF PathToSource AS ANY, _
                                                                                 BYREF SourceFile AS ANY, _
                                                                                 BYREF TargetPathFile AS ANY, _
                                                                                 BYVAL Win32ErrorCode AS DWORD, _
                                                                                 BYVAL STYLE AS DWORD, _
                                                                                 BYREF PathBuffer AS ANY, _
                                                                                 BYVAL PathBufferSize AS DWORD, _
                                                                                 BYREF PathRequiredSize AS DWORD) AS DWORD
    MACRO SetupCopyError(hwndParent, DialogTitle, DiskName, PathToSource, SourceFile, TargetPathFile, Win32ErrorCode, STYLE, PathBuffer, PathBufferSize, PathRequiredSize) = _
    SetupCopyErrorW(hwndParent, DialogTitle, DiskName, PathToSource, SourceFile, TargetPathFile, Win32ErrorCode, STYLE, PathBuffer, PathBufferSize, PathRequiredSize)
    
    DECLARE FUNCTION SetupRenameErrorW LIB "SETUPAPI.DLL" ALIAS "SetupRenameErrorW" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ANY, _
                                                                                     BYREF SourceFile AS ANY, _
                                                                                     BYREF TargetFile AS ANY, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupRenameError(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE) = SetupRenameErrorW(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupDeleteErrorW LIB "SETUPAPI.DLL" ALIAS "SetupDeleteErrorW" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ANY, _
                                                                                     BYREF File AS ANY, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupDeleteError(hwndParent, DialogTitle, File, Win32ErrorCode, STYLE) = SetupDeleteErrorW(hwndParent, DialogTitle, File, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupBackupErrorW LIB "SETUPAPI.DLL" ALIAS "SetupBackupErrorW" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ANY, _
                                                                                     BYREF SourceFile AS ANY, _
                                                                                     BYREF TargetFile AS ANY, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupBackupError(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE) = SetupBackupErrorW(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupSetDirectoryIdW LIB "SETUPAPI.DLL" ALIAS "SetupSetDirectoryIdW" (BYVAL InfHandle AS HINF, _
                                                                                           BYVAL Id AS DWORD, _
                                                                                           BYREF Directory AS ANY) AS LONG
    MACRO SetupSetDirectoryId(InfHandle, Id, Directory) = SetupSetDirectoryIdW(InfHandle, Id, Directory)
    
    DECLARE FUNCTION SetupSetDirectoryIdExW LIB "SETUPAPI.DLL" ALIAS "SetupSetDirectoryIdExW" (BYVAL InfHandle AS HINF, _
                                                                                               BYVAL Id AS DWORD, _
                                                                                               BYREF Directory AS ANY, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL Reserved1 AS DWORD, _
                                                                                               BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupSetDirectoryIdEx(InfHandle, Id, Directory, Flags, Reserved1, Reserved2) = SetupSetDirectoryIdExW(InfHandle, Id, Directory, Flags, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupGetSourceInfoW LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceInfoW" (BYVAL InfHandle AS HINF, _
                                                                                         BYVAL SourceId AS DWORD, _
                                                                                         BYVAL InfoDesired AS DWORD, _
                                                                                         BYREF ReturnBuffer AS ANY, _
                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetSourceInfo(InfHandle, SourceId, InfoDesired, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetSourceInfoW(InfHandle, SourceId, InfoDesired, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupInstallFileW LIB "SETUPAPI.DLL" ALIAS "SetupInstallFileW" (BYVAL InfHandle AS HINF, _
                                                                                     BYREF inContext AS INFCONTEXT, _
                                                                                     BYREF SourceFile AS ANY, _
                                                                                     BYREF SourcePathRoot AS ANY, _
                                                                                     BYREF DestinationName AS ANY, _
                                                                                     BYVAL CopyStyle AS DWORD, _
                                                                                     BYVAL CopyMsgHandler AS DWORD, _
                                                                                     BYREF inContext AS ANY) AS LONG
    MACRO SetupInstallFile(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext) = SetupInstallFileW(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext)
    
    DECLARE FUNCTION SetupInstallFileExW LIB "SETUPAPI.DLL" ALIAS "SetupInstallFileExW" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                         BYREF SourceFile AS ANY, _
                                                                                         BYREF SourcePathRoot AS ANY, _
                                                                                         BYREF DestinationName AS ANY, _
                                                                                         BYVAL CopyStyle AS DWORD, _
                                                                                         BYVAL CopyMsgHandler AS DWORD, _
                                                                                         BYREF inContext AS ANY, _
                                                                                         BYREF FileWasInUse AS LONG) AS LONG
    MACRO SetupInstallFileEx(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext, FileWasInUse) = _
    SetupInstallFileExW(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext, FileWasInUse)
    
    DECLARE FUNCTION SetupSetFileQueueAlternatePlatformW LIB "SETUPAPI.DLL" ALIAS "SetupSetFileQueueAlternatePlatformW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                                         BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                         BYREF AlternateDefaultCatalogFile AS ANY) AS LONG
    MACRO SetupSetFileQueueAlternatePlatform(QueueHandle, AlternatePlatformInfo, AlternateDefaultCatalogFile) = SetupSetFileQueueAlternatePlatformW(QueueHandle, AlternatePlatformInfo, AlternateDefaultCatalogFile)
    
    DECLARE FUNCTION SetupSetPlatformPathOverrideW LIB "SETUPAPI.DLL" ALIAS "SetupSetPlatformPathOverrideW" (BYREF Override AS ANY) AS LONG
    MACRO SetupSetPlatformPathOverride(Override) = SetupSetPlatformPathOverrideW(Override)
    
    DECLARE FUNCTION SetupQueueCopyW LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopyW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                 BYREF SourceRootPath AS ANY, _
                                                                                 BYREF SourcePath AS ANY, _
                                                                                 BYREF SourceFilename AS ANY, _
                                                                                 BYREF SourceDescription AS ANY, _
                                                                                 BYREF SourceTagfile AS ANY, _
                                                                                 BYREF TargetDirectory AS ANY, _
                                                                                 BYREF TargetFilename AS ANY, _
                                                                                 BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueCopy(QueueHandle, SourceRootPath, SourcePath, SourceFilename, SourceDescription, SourceTagfile, TargetDirectory, TargetFilename, CopyStyle) = _
    SetupQueueCopyW(QueueHandle, SourceRootPath, SourcePath, SourceFilename, SourceDescription, SourceTagfile, TargetDirectory, TargetFilename, CopyStyle)
    
    DECLARE FUNCTION SetupQueueCopyIndirectW LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopyIndirectW" (BYREF CopyParams AS SP_FILE_COPY_PARAMS_W) AS LONG
    MACRO SetupQueueCopyIndirect(CopyParams) = SetupQueueCopyIndirectW(CopyParams)
    
    DECLARE FUNCTION SetupQueueDefaultCopyW LIB "SETUPAPI.DLL" ALIAS "SetupQueueDefaultCopyW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                               BYVAL InfHandle AS HINF, _
                                                                                               BYREF SourceRootPath AS ANY, _
                                                                                               BYREF SourceFilename AS ANY, _
                                                                                               BYREF TargetFilename AS ANY, _
                                                                                               BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueDefaultCopy(QueueHandle, InfHandle, SourceRootPath, SourceFilename, TargetFilename, CopyStyle) = SetupQueueDefaultCopyW(QueueHandle, InfHandle, SourceRootPath, SourceFilename, TargetFilename, CopyStyle)
    
    DECLARE FUNCTION SetupQueueCopySectionW LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopySectionW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                               BYREF SourceRootPath AS ANY, _
                                                                                               BYVAL InfHandle AS HINF, _
                                                                                               BYVAL ListInfHandle AS HINF, _
                                                                                               BYREF Section AS ANY, _
                                                                                               BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueCopySection(QueueHandle, SourceRootPath, InfHandle, ListInfHandle, Section, CopyStyle) = SetupQueueCopySectionW(QueueHandle, SourceRootPath, InfHandle, ListInfHandle, Section, CopyStyle)
    
    DECLARE FUNCTION SetupQueueDeleteW LIB "SETUPAPI.DLL" ALIAS "SetupQueueDeleteW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                     BYREF PathPart1 AS ANY, _
                                                                                     BYREF PathPart2 AS ANY) AS LONG
    MACRO SetupQueueDelete(QueueHandle, PathPart1, PathPart2) = SetupQueueDeleteW(QueueHandle, PathPart1, PathPart2)
    
    DECLARE FUNCTION SetupQueueDeleteSectionW LIB "SETUPAPI.DLL" ALIAS "SetupQueueDeleteSectionW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                   BYVAL InfHandle AS HINF, _
                                                                                                   BYVAL ListInfHandle AS HINF, _
                                                                                                   BYREF Section AS ANY) AS LONG
    MACRO SetupQueueDeleteSection(QueueHandle, InfHandle, ListInfHandle, Section) = SetupQueueDeleteSectionW(QueueHandle, InfHandle, ListInfHandle, Section)
    
    DECLARE FUNCTION SetupQueueRenameW LIB "SETUPAPI.DLL" ALIAS "SetupQueueRenameW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                     BYREF SourcePath AS ANY, _
                                                                                     BYREF SourceFilename AS ANY, _
                                                                                     BYREF TargetPath AS ANY, _
                                                                                     BYREF TargetFilename AS ANY) AS LONG
    MACRO SetupQueueRename(QueueHandle, SourcePath, SourceFilename, TargetPath, TargetFilename) = SetupQueueRenameW(QueueHandle, SourcePath, SourceFilename, TargetPath, TargetFilename)
    
    DECLARE FUNCTION SetupQueueRenameSectionW LIB "SETUPAPI.DLL" ALIAS "SetupQueueRenameSectionW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                   BYVAL InfHandle AS HINF, _
                                                                                                   BYVAL ListInfHandle AS HINF, _
                                                                                                   BYREF Section AS ANY) AS LONG
    MACRO SetupQueueRenameSection(QueueHandle, InfHandle, ListInfHandle, Section) = SetupQueueRenameSectionW(QueueHandle, InfHandle, ListInfHandle, Section)
    
    DECLARE FUNCTION SetupCommitFileQueueW LIB "SETUPAPI.DLL" ALIAS "SetupCommitFileQueueW" (BYVAL Owner AS DWORD, _
                                                                                             BYVAL QueueHandle AS HSPFILEQ, _
                                                                                             BYVAL MsgHandler AS DWORD, _
                                                                                             BYREF inContext AS ANY) AS LONG
    MACRO SetupCommitFileQueue(Owner, QueueHandle, MsgHandler, inContext) = SetupCommitFileQueueW(Owner, QueueHandle, MsgHandler, inContext)
    
    DECLARE FUNCTION SetupScanFileQueueW LIB "SETUPAPI.DLL" ALIAS "SetupScanFileQueueW" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                         BYVAL Flags AS DWORD, _
                                                                                         BYVAL WINDOW AS DWORD, _
                                                                                         BYVAL CallbackRoutine AS DWORD, _
                                                                                         BYREF CallbackContext AS ANY, _
                                                                                         BYREF Result AS DWORD) AS LONG
    MACRO SetupScanFileQueue(FileQueue, Flags, WINDOW, CallbackRoutine, CallbackContext, Result) = SetupScanFileQueueW(FileQueue, Flags, WINDOW, CallbackRoutine, CallbackContext, Result)
    
    DECLARE FUNCTION SetupCopyOEMInfW LIB "SETUPAPI.DLL" ALIAS "SetupCopyOEMInfW" (BYREF SourceInfFileName AS ANY, _
                                                                                   BYREF OEMSourceMediaLocation AS ANY, _
                                                                                   BYVAL OEMSourceMediaType AS DWORD, _
                                                                                   BYVAL CopyStyle AS DWORD, _
                                                                                   BYREF DestinationInfFileName AS ANY, _
                                                                                   BYVAL DestinationInfFileNameSize AS DWORD, _
                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                   BYREF DestinationInfFileNameComponent AS ANY) AS LONG
    MACRO SetupCopyOEMInf(SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType, CopyStyle, DestinationInfFileName, DestinationInfFileNameSize, RequiredSize, DestinationInfFileNameComponent) = _
    SetupCopyOEMInfW(SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType, CopyStyle, DestinationInfFileName, DestinationInfFileNameSize, RequiredSize, DestinationInfFileNameComponent)
    
    DECLARE FUNCTION SetupUninstallOEMInfW LIB "SETUPAPI.DLL" ALIAS "SetupUninstallOEMInfW" (BYREF InfFileName AS ANY, _
                                                                                             BYVAL Flags AS DWORD, _
                                                                                             BYREF Reserved AS ANY) AS LONG
    MACRO SetupUninstallOEMInf(InfFileName, Flags, Reserved) = SetupUninstallOEMInfW(InfFileName, Flags, Reserved)
    
    DECLARE FUNCTION SetupCreateDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupCreateDiskSpaceListW" (BYREF Reserved1 AS ANY, _
                                                                                                     BYVAL Reserved2 AS DWORD, _
                                                                                                     BYVAL Flags AS DWORD) AS HDSKSPC
    MACRO SetupCreateDiskSpaceList(Reserved1, Reserved2, Flags) = SetupCreateDiskSpaceListW(Reserved1, Reserved2, Flags)
    
    DECLARE FUNCTION SetupDuplicateDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupDuplicateDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                           BYREF Reserved1 AS ANY, _
                                                                                                           BYVAL Reserved2 AS DWORD, _
                                                                                                           BYVAL Flags AS DWORD) AS HDSKSPC
    MACRO SetupDuplicateDiskSpaceList(DiskSpace, Reserved1, Reserved2, Flags) = SetupDuplicateDiskSpaceListW(DiskSpace, Reserved1, Reserved2, Flags)
    
    DECLARE FUNCTION SetupQueryDrivesInDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupQueryDrivesInDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                   BYREF ReturnBuffer AS ANY, _
                                                                                                                   BYVAL ReturnBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryDrivesInDiskSpaceList(DiskSpace, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryDrivesInDiskSpaceListW(DiskSpace, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQuerySpaceRequiredOnDriveW LIB "SETUPAPI.DLL" ALIAS "SetupQuerySpaceRequiredOnDriveW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                 BYREF DriveSpec AS ANY, _
                                                                                                                 BYREF SpaceRequired AS QUAD, _
                                                                                                                 BYREF Reserved1 AS ANY, _
                                                                                                                 BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupQuerySpaceRequiredOnDrive(DiskSpace, DriveSpec, SpaceRequired, Reserved1, Reserved2) = SetupQuerySpaceRequiredOnDriveW(DiskSpace, DriveSpec, SpaceRequired, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAdjustDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupAdjustDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                     BYREF DriveRoot AS ANY, _
                                                                                                     BYVAL Amount AS QUAD, _
                                                                                                     BYREF Reserved1 AS ANY, _
                                                                                                     BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAdjustDiskSpaceList(DiskSpace, DriveRoot, Amount, Reserved1, Reserved2) = SetupAdjustDiskSpaceListW(DiskSpace, DriveRoot, Amount, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddToDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupAddToDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                   BYREF TargetFilespec AS ANY, _
                                                                                                   BYVAL FileSize AS QUAD, _
                                                                                                   BYVAL Operation AS DWORD, _
                                                                                                   BYREF Reserved1 AS ANY, _
                                                                                                   BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddToDiskSpaceList(DiskSpace, TargetFilespec, FileSize, Operation, Reserved1, Reserved2) = SetupAddToDiskSpaceListW(DiskSpace, TargetFilespec, FileSize, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddSectionToDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupAddSectionToDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                                 BYVAL ListInfHandle AS HINF, _
                                                                                                                 BYREF SectionName AS ANY, _
                                                                                                                 BYVAL Operation AS DWORD, _
                                                                                                                 BYREF Reserved1 AS ANY, _
                                                                                                                 BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddSectionToDiskSpaceList(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2) = SetupAddSectionToDiskSpaceListW(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddInstallSectionToDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupAddInstallSectionToDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                               BYVAL InfHandle AS HINF, _
                                                                                                                               BYVAL LayoutInfHandle AS HINF, _
                                                                                                                               BYREF SectionName AS ANY, _
                                                                                                                               BYREF Reserved1 AS ANY, _
                                                                                                                               BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddInstallSectionToDiskSpaceList(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2) = SetupAddInstallSectionToDiskSpaceListW(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveFromDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFromDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                             BYREF TargetFilespec AS ANY, _
                                                                                                             BYVAL Operation AS DWORD, _
                                                                                                             BYREF Reserved1 AS ANY, _
                                                                                                             BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveFromDiskSpaceList(DiskSpace, TargetFilespec, Operation, Reserved1, Reserved2) = SetupRemoveFromDiskSpaceListW(DiskSpace, TargetFilespec, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveSectionFromDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupRemoveSectionFromDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                           BYVAL InfHandle AS HINF, _
                                                                                                                           BYVAL ListInfHandle AS HINF, _
                                                                                                                           BYREF SectionName AS ANY, _
                                                                                                                           BYVAL Operation AS DWORD, _
                                                                                                                           BYREF Reserved1 AS ANY, _
                                                                                                                           BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveSectionFromDiskSpaceList(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2) = SetupRemoveSectionFromDiskSpaceListW(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveInstallSectionFromDiskSpaceListW LIB "SETUPAPI.DLL" ALIAS "SetupRemoveInstallSectionFromDiskSpaceListW" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                                                         BYVAL LayoutInfHandle AS HINF, _
                                                                                                                                         BYREF SectionName AS ANY, _
                                                                                                                                         BYREF Reserved1 AS ANY, _
                                                                                                                                         BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveInstallSectionFromDiskSpaceList(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2) = SetupRemoveInstallSectionFromDiskSpaceListW(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupIterateCabinetW LIB "SETUPAPI.DLL" ALIAS "SetupIterateCabinetW" (BYREF CabinetFile AS ANY, _
                                                                                           BYVAL Reserved AS DWORD, _
                                                                                           BYVAL MsgHandler AS DWORD, _
                                                                                           BYREF inContext AS ANY) AS LONG
    MACRO SetupIterateCabinet(CabinetFile, Reserved, MsgHandler, inContext) = SetupIterateCabinetW(CabinetFile, Reserved, MsgHandler, inContext)
    
    DECLARE FUNCTION SetupDefaultQueueCallbackW LIB "SETUPAPI.DLL" ALIAS "SetupDefaultQueueCallbackW" (BYREF inContext AS ANY, _
                                                                                                       BYVAL Notification AS DWORD, _
                                                                                                       BYREF Param1 AS DWORD, _
                                                                                                       BYREF Param2 AS DWORD) AS DWORD
    MACRO SetupDefaultQueueCallback(inContext, Notification, Param1, Param2) = SetupDefaultQueueCallbackW(inContext, Notification, Param1, Param2)
    
    DECLARE FUNCTION SetupInstallFromInfSectionW LIB "SETUPAPI.DLL" ALIAS "SetupInstallFromInfSectionW" (BYVAL Owner AS DWORD, _
                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                         BYREF SectionName AS ANY, _
                                                                                                         BYVAL Flags AS DWORD, _
                                                                                                         BYVAL RelativeKeyRoot AS DWORD, _
                                                                                                         BYREF SourceRootPath AS ANY, _
                                                                                                         BYVAL CopyFlags AS DWORD, _
                                                                                                         BYVAL MsgHandler AS DWORD, _
                                                                                                         BYREF inContext AS ANY, _
                                                                                                         BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF PSP_DEVINFO_DATA AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupInstallFromInfSection(Owner, InfHandle, SectionName, Flags, RelativeKeyRoot, SourceRootPath, CopyFlags, MsgHandler, inContext, DeviceInfoSet, PSP_DEVINFO_DATA) = _
    SetupInstallFromInfSectionW(Owner, InfHandle, SectionName, Flags, RelativeKeyRoot, SourceRootPath, CopyFlags, MsgHandler, inContext, DeviceInfoSet, PSP_DEVINFO_DATA)
    
    DECLARE FUNCTION SetupInstallFilesFromInfSectionW LIB "SETUPAPI.DLL" ALIAS "SetupInstallFilesFromInfSectionW" (BYVAL InfHandle AS HINF, _
                                                                                                                   BYVAL LayoutInfHandle AS HINF, _
                                                                                                                   BYVAL FileQueue AS HSPFILEQ, _
                                                                                                                   BYREF SectionName AS ANY, _
                                                                                                                   BYREF SourceRootPath AS ANY, _
                                                                                                                   BYVAL CopyFlags AS DWORD) AS LONG
    MACRO SetupInstallFilesFromInfSection(InfHandle, LayoutInfHandle, FileQueue, SectionName, SourceRootPath, CopyFlags) = SetupInstallFilesFromInfSectionW(InfHandle, LayoutInfHandle, FileQueue, SectionName, SourceRootPath, CopyFlags)
    
    DECLARE FUNCTION SetupInstallServicesFromInfSectionW LIB "SETUPAPI.DLL" ALIAS "SetupInstallServicesFromInfSectionW" (BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF SectionName AS ANY, _
                                                                                                                         BYVAL Flags AS DWORD) AS LONG
    MACRO SetupInstallServicesFromInfSection(InfHandle, SectionName, Flags) = SetupInstallServicesFromInfSectionW(InfHandle, SectionName, Flags)
    
    DECLARE FUNCTION SetupInstallServicesFromInfSectionExW LIB "SETUPAPI.DLL" ALIAS "SetupInstallServicesFromInfSectionExW" (BYVAL InfHandle AS HINF, _
                                                                                                                             BYREF SectionName AS ANY, _
                                                                                                                             BYVAL Flags AS DWORD, _
                                                                                                                             BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                             BYREF Reserved1 AS ANY, _
                                                                                                                             BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupInstallServicesFromInfSectionEx(InfHandle, SectionName, Flags, DeviceInfoSet, DeviceInfoData, Reserved1, Reserved2) = SetupInstallServicesFromInfSectionExW(InfHandle, SectionName, Flags, DeviceInfoSet, DeviceInfoData, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupInitializeFileLogW LIB "SETUPAPI.DLL" ALIAS "SetupInitializeFileLogW" (BYREF LogFileName AS ANY, _
                                                                                                 BYVAL Flags AS DWORD) AS HSPFILELOG
    MACRO SetupInitializeFileLog(LogFileName, Flags) = SetupInitializeFileLogW(LogFileName, Flags)
    
    DECLARE FUNCTION SetupLogFileW LIB "SETUPAPI.DLL" ALIAS "SetupLogFileW" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                             BYREF LogSectionName AS ANY, _
                                                                             BYREF SourceFilename AS ANY, _
                                                                             BYREF TargetFilename AS ANY, _
                                                                             BYVAL Checksum AS DWORD, _
                                                                             BYREF DiskTagfile AS ANY, _
                                                                             BYREF DiskDescription AS ANY, _
                                                                             BYREF OtherInfo AS ANY, _
                                                                             BYVAL Flags AS DWORD) AS LONG
    MACRO SetupLogFile(FileLogHandle, LogSectionName, SourceFilename, TargetFilename, Checksum, DiskTagfile, DiskDescription, OtherInfo, Flags) = _
    SetupLogFileW(FileLogHandle, LogSectionName, SourceFilename, TargetFilename, Checksum, DiskTagfile, DiskDescription, OtherInfo, Flags)
    
    DECLARE FUNCTION SetupRemoveFileLogEntryW LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFileLogEntryW" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                                                   BYREF LogSectionName AS ANY, _
                                                                                                   BYREF TargetFilename AS ANY) AS LONG
    MACRO SetupRemoveFileLogEntry(FileLogHandle, LogSectionName, TargetFilename) = SetupRemoveFileLogEntryW(FileLogHandle, LogSectionName, TargetFilename)
    
    DECLARE FUNCTION SetupQueryFileLogW LIB "SETUPAPI.DLL" ALIAS "SetupQueryFileLogW" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                                       BYREF LogSectionName AS ANY, _
                                                                                       BYREF TargetFilename AS ANY, _
                                                                                       BYVAL DesiredInfo AS LONG, _
                                                                                       BYREF DataOut AS ANY, _
                                                                                       BYVAL ReturnBufferSize AS DWORD, _
                                                                                       BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryFileLog(FileLogHandle, LogSectionName, TargetFilename, DesiredInfo, DataOut, ReturnBufferSize, RequiredSize) = SetupQueryFileLogW(FileLogHandle, LogSectionName, TargetFilename, DesiredInfo, DataOut, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupLogErrorW LIB "SETUPAPI.DLL" ALIAS "SetupLogErrorW" (BYREF MessageString AS ANY, _
                                                                               BYVAL Severity AS LogSeverity) AS LONG
    MACRO SetupLogError(MessageString, Severity) = SetupLogErrorW(MessageString, Severity)
    
    DECLARE FUNCTION SetupGetBackupInformationW LIB "SETUPAPI.DLL" ALIAS "SetupGetBackupInformationW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                       BYREF BackupParams AS SP_BACKUP_QUEUE_PARAMS_W) AS LONG
    MACRO SetupGetBackupInformation(QueueHandle, BackupParams) = SetupGetBackupInformationW(QueueHandle, BackupParams)
    
    DECLARE FUNCTION SetupPrepareQueueForRestoreW LIB "SETUPAPI.DLL" ALIAS "SetupPrepareQueueForRestoreW" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                           BYREF BackupPath AS ANY, _
                                                                                                           BYVAL RestoreFlags AS DWORD) AS LONG
    MACRO SetupPrepareQueueForRestore(QueueHandle, BackupPath, RestoreFlags) = SetupPrepareQueueForRestoreW(QueueHandle, BackupPath, RestoreFlags)
    
    DECLARE FUNCTION SetupDiCreateDeviceInfoListExW LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInfoListExW" (BYREF ClassGuid AS GUID, _
                                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                                               BYREF MachineName AS ANY, _
                                                                                                               BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiCreateDeviceInfoListEx(ClassGuid, hwndParent, MachineName, Reserved) = SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceInfoListDetailW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInfoListDetailW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                 BYREF DeviceInfoSetDetailData AS SP_DEVINFO_LIST_DETAIL_DATA_W) AS LONG
    MACRO SetupDiGetDeviceInfoListDetail(DeviceInfoSet, DeviceInfoSetDetailData) = SetupDiGetDeviceInfoListDetailW(DeviceInfoSet, DeviceInfoSetDetailData)
    
    DECLARE FUNCTION SetupDiCreateDeviceInfoW LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInfoW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                   BYREF DeviceName AS ANY, _
                                                                                                   BYREF ClassGuid AS GUID, _
                                                                                                   BYREF DeviceDescription AS ANY, _
                                                                                                   BYVAL hwndParent AS DWORD, _
                                                                                                   BYVAL CreationFlags AS DWORD, _
                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiCreateDeviceInfo(DeviceInfoSet, DeviceName, ClassGuid, DeviceDescription, hwndParent, CreationFlags, DeviceInfoData) = SetupDiCreateDeviceInfoW(DeviceInfoSet, DeviceName, ClassGuid, DeviceDescription, hwndParent, CreationFlags, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiOpenDeviceInfoW LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDeviceInfoW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF DeviceInstanceId AS ANY, _
                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                               BYVAL OpenFlags AS DWORD, _
                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiOpenDeviceInfo(DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData) = SetupDiOpenDeviceInfoW(DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiGetDeviceInstanceIdW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInstanceIdW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                         BYREF DeviceInstanceId AS ANY, _
                                                                                                         BYVAL DeviceInstanceIdSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDeviceInstanceId(DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize) = SetupDiGetDeviceInstanceIdW(DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiCreateDeviceInterfaceW LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInterfaceW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF InterfaceClassGuid AS GUID, _
                                                                                                             BYREF ReferenceString AS ANY, _
                                                                                                             BYVAL CreationFlags AS DWORD, _
                                                                                                             BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    MACRO SetupDiCreateDeviceInterface(DeviceInfoSet, DeviceInfoData, InterfaceClassGuid, ReferenceString, CreationFlags, DeviceInterfaceData) = _
    SetupDiCreateDeviceInterfaceW(DeviceInfoSet, DeviceInfoData, InterfaceClassGuid, ReferenceString, CreationFlags, DeviceInterfaceData)
    
    DECLARE FUNCTION SetupDiOpenDeviceInterfaceW LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDeviceInterfaceW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DevicePath AS ANY, _
                                                                                                         BYVAL OpenFlags AS DWORD, _
                                                                                                         BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    MACRO SetupDiOpenDeviceInterface(DeviceInfoSet, DevicePath, OpenFlags, DeviceInterfaceData) = SetupDiOpenDeviceInterfaceW(DeviceInfoSet, DevicePath, OpenFlags, DeviceInterfaceData)
    
    DECLARE FUNCTION SetupDiGetDeviceInterfaceDetailW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInterfaceDetailW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                   BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                   BYREF DeviceInterfaceDetailData AS SP_DEVICE_INTERFACE_DETAIL_DATA_W, _
                                                                                                                   BYVAL DeviceInterfaceDetailDataSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiGetDeviceInterfaceDetail(DeviceInfoSet, DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData) = _
    SetupDiGetDeviceInterfaceDetailW(DeviceInfoSet, DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiEnumDriverInfoW LIB "SETUPAPI.DLL" ALIAS "SetupDiEnumDriverInfoW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                               BYVAL DriverType AS DWORD, _
                                                                                               BYVAL MemberIndex AS DWORD, _
                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_W) AS LONG
    MACRO SetupDiEnumDriverInfo(DeviceInfoSet, DeviceInfoData, DriverType, MemberIndex, DriverInfoData) = SetupDiEnumDriverInfoW(DeviceInfoSet, DeviceInfoData, DriverType, MemberIndex, DriverInfoData)
    
    DECLARE FUNCTION SetupDiGetSelectedDriverW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetSelectedDriverW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                     BYREF DriverInfoData AS SP_DRVINFO_DATA_W) AS LONG
    MACRO SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, DriverInfoData) = SetupDiGetSelectedDriverW(DeviceInfoSet, DeviceInfoData, DriverInfoData)
    
    DECLARE FUNCTION SetupDiSetSelectedDriverW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetSelectedDriverW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                     BYREF DriverInfoData AS ANY) AS LONG
    MACRO SetupDiSetSelectedDriver(DeviceInfoSet, DeviceInfoData, DriverInfoData) = SetupDiSetSelectedDriverW(DeviceInfoSet, DeviceInfoData, DriverInfoData)
    
    DECLARE FUNCTION SetupDiGetDriverInfoDetailW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDriverInfoDetailW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                         BYREF DriverInfoData AS SP_DRVINFO_DATA_W, _
                                                                                                         BYREF DriverInfoDetailData AS SP_DRVINFO_DETAIL_DATA_W, _
                                                                                                         BYVAL DriverInfoDetailDataSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDriverInfoDetail(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, RequiredSize) = _
    SetupDiGetDriverInfoDetailW(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassDevsW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevsW" (BYREF ClassGuid AS GUID, _
                                                                                           BYREF Enumerator AS ANY, _
                                                                                           BYVAL hwndParent AS DWORD, _
                                                                                           BYVAL Flags AS DWORD) AS DWORD
    MACRO SetupDiGetClassDevs(ClassGuid, Enumerator, hwndParent, Flags) = SetupDiGetClassDevsW(ClassGuid, Enumerator, hwndParent, Flags)
    
    DECLARE FUNCTION SetupDiGetClassDevsExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevsExW" (BYREF ClassGuid AS GUID, _
                                                                                               BYREF Enumerator AS ANY, _
                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF MachineName AS ANY, _
                                                                                               BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiGetClassDevsEx(ClassGuid, Enumerator, hwndParent, Flags, DeviceInfoSet, MachineName, Reserved) = SetupDiGetClassDevsExW(ClassGuid, Enumerator, hwndParent, Flags, DeviceInfoSet, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetINFClassW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetINFClassW" (BYREF InfName AS ANY, _
                                                                                         BYREF ClassGuid AS GUID, _
                                                                                         BYREF ClassName AS ANY, _
                                                                                         BYVAL ClassNameSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetINFClass(InfName, ClassGuid, ClassName, ClassNameSize, RequiredSize) = SetupDiGetINFClassW(InfName, ClassGuid, ClassName, ClassNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiBuildClassInfoListExW LIB "SETUPAPI.DLL" ALIAS "SetupDiBuildClassInfoListExW" (BYVAL Flags AS DWORD, _
                                                                                                           BYREF ClassGuidList AS GUID, _
                                                                                                           BYVAL ClassGuidListSize AS DWORD, _
                                                                                                           BYREF RequiredSize AS DWORD, _
                                                                                                           BYREF MachineName AS ANY, _
                                                                                                           BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiBuildClassInfoListEx(Flags, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved) = SetupDiBuildClassInfoListExW(Flags, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetClassDescriptionW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDescriptionW" (BYREF ClassGuid AS GUID, _
                                                                                                         BYREF ClassDescription AS ANY, _
                                                                                                         BYVAL ClassDescriptionSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetClassDescription(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize) = SetupDiGetClassDescriptionW(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassDescriptionExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDescriptionExW" (BYREF ClassGuid AS GUID, _
                                                                                                             BYREF ClassDescription AS ANY, _
                                                                                                             BYVAL ClassDescriptionSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD, _
                                                                                                             BYREF MachineName AS ANY, _
                                                                                                             BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassDescriptionEx(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize, MachineName, Reserved) = SetupDiGetClassDescriptionExW(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiInstallClassW LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallClassW" (BYVAL hwndParent AS DWORD, _
                                                                                           BYREF InfFileName AS ANY, _
                                                                                           BYVAL Flags AS DWORD, _
                                                                                           BYVAL FileQueue AS HSPFILEQ) AS LONG
    MACRO SetupDiInstallClass(hwndParent, InfFileName, Flags, FileQueue) = SetupDiInstallClassW(hwndParent, InfFileName, Flags, FileQueue)
    
    DECLARE FUNCTION SetupDiInstallClassExW LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallClassExW" (BYVAL hwndParent AS DWORD, _
                                                                                               BYREF InfFileName AS ANY, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL FileQueue AS HSPFILEQ, _
                                                                                               BYREF InterfaceClassGuid AS GUID, _
                                                                                               BYREF Reserved1 AS ANY, _
                                                                                               BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupDiInstallClassEx(hwndParent, InfFileName, Flags, FileQueue, InterfaceClassGuid, Reserved1, Reserved2) = SetupDiInstallClassExW(hwndParent, InfFileName, Flags, FileQueue, InterfaceClassGuid, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupDiOpenClassRegKeyExW LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenClassRegKeyExW" (BYREF ClassGuid AS GUID, _
                                                                                                     BYVAL samDesired AS DWORD, _
                                                                                                     BYVAL Flags AS DWORD, _
                                                                                                     BYREF MachineName AS ANY, _
                                                                                                     BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiOpenClassRegKeyEx(ClassGuid, samDesired, Flags, MachineName, Reserved) = SetupDiOpenClassRegKeyExW(ClassGuid, samDesired, Flags, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiCreateDeviceInterfaceRegKeyW LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInterfaceRegKeyW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                         BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                         BYVAL Reserved AS DWORD, _
                                                                                                                         BYVAL samDesired AS DWORD, _
                                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF InfSectionName AS ANY) AS DWORD
    MACRO SetupDiCreateDeviceInterfaceRegKey(DeviceInfoSet, DeviceInterfaceData, Reserved, samDesired, InfHandle, InfSectionName) = SetupDiCreateDeviceInterfaceRegKeyW(DeviceInfoSet, DeviceInterfaceData, Reserved, samDesired, InfHandle, InfSectionName)
    
    DECLARE FUNCTION SetupDiCreateDevRegKeyW LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDevRegKeyW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                 BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                 BYVAL Scope AS DWORD, _
                                                                                                 BYVAL HwProfile AS DWORD, _
                                                                                                 BYVAL KeyType AS DWORD, _
                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                 BYREF InfSectionName AS ANY) AS DWORD
    MACRO SetupDiCreateDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, InfHandle, InfSectionName) = SetupDiCreateDevRegKeyW(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, InfHandle, InfSectionName)
    
    DECLARE FUNCTION SetupDiGetHwProfileListExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileListExW" (BYREF HwProfileList AS DWORD, _
                                                                                                       BYVAL HwProfileListSize AS DWORD, _
                                                                                                       BYREF RequiredSize AS DWORD, _
                                                                                                       BYREF CurrentlyActiveIndex AS DWORD, _
                                                                                                       BYREF MachineName AS ANY, _
                                                                                                       BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetHwProfileListEx(HwProfileList, HwProfileListSize, RequiredSize, CurrentlyActiveIndex, MachineName, Reserved) = SetupDiGetHwProfileListExW(HwProfileList, HwProfileListSize, RequiredSize, CurrentlyActiveIndex, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceRegistryPropertyW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceRegistryPropertyW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                     BYVAL Property AS DWORD, _
                                                                                                                     BYREF PropertyRegDataType AS DWORD, _
                                                                                                                     BYREF PropertyBuffer AS ANY, _
                                                                                                                     BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDeviceRegistryProperty(DeviceInfoSet, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize) = _
    SetupDiGetDeviceRegistryPropertyW(DeviceInfoSet, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassRegistryPropertyW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassRegistryPropertyW" (BYREF ClassGuid AS GUID, _
                                                                                                                   BYVAL Property AS DWORD, _
                                                                                                                   BYREF PropertyRegDataType AS DWORD, _
                                                                                                                   BYREF PropertyBuffer AS ANY, _
                                                                                                                   BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                                                   BYREF MachineName AS ANY, _
                                                                                                                   BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassRegistryProperty(ClassGuid, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize, MachineName, Reserved) = _
    SetupDiGetClassRegistryPropertyW(ClassGuid, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiSetDeviceRegistryPropertyW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDeviceRegistryPropertyW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS ANY, _
                                                                                                                     BYVAL Property AS DWORD, _
                                                                                                                     BYREF PropertyBuffer AS BYTE, _
                                                                                                                     BYVAL PropertyBufferSize AS DWORD) AS LONG
    MACRO SetupDiSetDeviceRegistryProperty(DeviceInfoSet, DeviceInfoData, Property, PropertyBuffer, PropertyBufferSize) = SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet, DeviceInfoData, Property, PropertyBuffer, PropertyBufferSize)
    
    DECLARE FUNCTION SetupDiSetClassRegistryPropertyW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetClassRegistryPropertyW" (BYREF ClassGuid AS GUID, _
                                                                                                                   BYVAL Property AS DWORD, _
                                                                                                                   BYREF PropertyBuffer AS BYTE, _
                                                                                                                   BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                   BYREF MachineName AS ANY, _
                                                                                                                   BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiSetClassRegistryProperty(ClassGuid, Property, PropertyBuffer, PropertyBufferSize, MachineName, Reserved) = SetupDiSetClassRegistryPropertyW(ClassGuid, Property, PropertyBuffer, PropertyBufferSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DeviceInstallParams AS SP_DEVINSTALL_PARAMS_W) AS LONG
    MACRO SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, DeviceInstallParams) = SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, DeviceInstallParams)
    
    DECLARE FUNCTION SetupDiGetClassInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF ClassInstallParams AS SP_CLASSINSTALL_HEADER, _
                                                                                                             BYVAL ClassInstallParamsSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetClassInstallParams(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize, RequiredSize) = SetupDiGetClassInstallParamsW(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiSetDeviceInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDeviceInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DeviceInstallParams AS SP_DEVINSTALL_PARAMS_W) AS LONG
    MACRO SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, DeviceInstallParams) = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, DeviceInstallParams)
    
    DECLARE FUNCTION SetupDiSetClassInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetClassInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF ClassInstallParams AS SP_CLASSINSTALL_HEADER, _
                                                                                                             BYVAL ClassInstallParamsSize AS DWORD) AS LONG
    MACRO SetupDiSetClassInstallParams(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize) = SetupDiSetClassInstallParamsW(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize)
    
    DECLARE FUNCTION SetupDiGetDriverInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDriverInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_W, _
                                                                                                               BYREF DriverInstallParams AS SP_DRVINSTALL_PARAMS) AS LONG
    MACRO SetupDiGetDriverInstallParams(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams) = SetupDiGetDriverInstallParamsW(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams)
    
    DECLARE FUNCTION SetupDiSetDriverInstallParamsW LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDriverInstallParamsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_W, _
                                                                                                               BYREF DriverInstallParams AS SP_DRVINSTALL_PARAMS) AS LONG
    MACRO SetupDiSetDriverInstallParams(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams) = SetupDiSetDriverInstallParamsW(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams)
    
    DECLARE FUNCTION SetupDiGetClassImageListExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassImageListExW" (BYREF ClassImageListData AS SP_CLASSIMAGELIST_DATA, _
                                                                                                         BYREF MachineName AS ANY, _
                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassImageListEx(ClassImageListData, MachineName, Reserved) = SetupDiGetClassImageListExW(ClassImageListData, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetClassDevPropertySheetsW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevPropertySheetsW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                     BYVAL PropertySheetHeader AS DWORD, _
                                                                                                                     BYVAL PropertySheetHeaderPageListSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD, _
                                                                                                                     BYVAL PropertySheetType AS DWORD) AS LONG
    MACRO SetupDiGetClassDevPropertySheets(DeviceInfoSet, DeviceInfoData, PropertySheetHeader, PropertySheetHeaderPageListSize, RequiredSize, PropertySheetType) = _
    SetupDiGetClassDevPropertySheetsW(DeviceInfoSet, DeviceInfoData, PropertySheetHeader, PropertySheetHeaderPageListSize, RequiredSize, PropertySheetType)
    
    DECLARE FUNCTION SetupDiClassNameFromGuidW LIB "SETUPAPI.DLL" ALIAS "SetupDiClassNameFromGuidW" (BYREF ClassGuid AS GUID, _
                                                                                                     BYREF ClassName AS ANY, _
                                                                                                     BYVAL ClassNameSize AS DWORD, _
                                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiClassNameFromGuid(ClassGuid, ClassName, ClassNameSize, RequiredSize) = SetupDiClassNameFromGuidW(ClassGuid, ClassName, ClassNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiClassNameFromGuidExW LIB "SETUPAPI.DLL" ALIAS "SetupDiClassNameFromGuidExW" (BYREF ClassGuid AS GUID, _
                                                                                                         BYREF ClassName AS ANY, _
                                                                                                         BYVAL ClassNameSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD, _
                                                                                                         BYREF MachineName AS ANY, _
                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiClassNameFromGuidEx(ClassGuid, ClassName, ClassNameSize, RequiredSize, MachineName, Reserved) = SetupDiClassNameFromGuidExW(ClassGuid, ClassName, ClassNameSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiClassGuidsFromNameW LIB "SETUPAPI.DLL" ALIAS "SetupDiClassGuidsFromNameW" (BYREF ClassName AS ANY, _
                                                                                                       BYREF ClassGuidList AS GUID, _
                                                                                                       BYVAL ClassGuidListSize AS DWORD, _
                                                                                                       BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiClassGuidsFromName(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize) = SetupDiClassGuidsFromNameW(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiClassGuidsFromNameExW LIB "SETUPAPI.DLL" ALIAS "SetupDiClassGuidsFromNameExW" (BYREF ClassName AS ANY, _
                                                                                                           BYREF ClassGuidList AS GUID, _
                                                                                                           BYVAL ClassGuidListSize AS DWORD, _
                                                                                                           BYREF RequiredSize AS DWORD, _
                                                                                                           BYREF MachineName AS ANY, _
                                                                                                           BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiClassGuidsFromNameEx(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved) = SetupDiClassGuidsFromNameExW(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetHwProfileFriendlyNameW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileFriendlyNameW" (BYVAL HwProfile AS DWORD, _
                                                                                                                   BYREF FriendlyName AS ANY, _
                                                                                                                   BYVAL FriendlyNameSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetHwProfileFriendlyName(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize) = SetupDiGetHwProfileFriendlyNameW(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetHwProfileFriendlyNameExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileFriendlyNameExW" (BYVAL HwProfile AS DWORD, _
                                                                                                                       BYREF FriendlyName AS ANY, _
                                                                                                                       BYVAL FriendlyNameSize AS DWORD, _
                                                                                                                       BYREF RequiredSize AS DWORD, _
                                                                                                                       BYREF MachineName AS ANY, _
                                                                                                                       BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetHwProfileFriendlyNameEx(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize, MachineName, Reserved) = SetupDiGetHwProfileFriendlyNameExW(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetActualSectionToInstallW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetActualSectionToInstallW" (BYVAL InfHandle AS HINF, _
                                                                                                                     BYREF InfSectionName AS ANY, _
                                                                                                                     BYREF InfSectionWithExt AS ANY, _
                                                                                                                     BYVAL InfSectionWithExtSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD, _
                                                                                                                     BYREF Extension AS ANY) AS LONG
    MACRO SetupDiGetActualSectionToInstall(InfHandle, InfSectionName, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension) = _
    SetupDiGetActualSectionToInstallW(InfHandle, InfSectionName, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension)
    
    DECLARE FUNCTION SetupDiGetActualSectionToInstallExW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetActualSectionToInstallExW" (BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF InfSectionName AS ANY, _
                                                                                                                         BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                         BYREF InfSectionWithExt AS ANY, _
                                                                                                                         BYVAL InfSectionWithExtSize AS DWORD, _
                                                                                                                         BYREF RequiredSize AS DWORD, _
                                                                                                                         BYREF Extension AS ANY, _
                                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetActualSectionToInstallEx(InfHandle, InfSectionName, AlternatePlatformInfo, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension, Reserved) = _
    SetupDiGetActualSectionToInstallExW(InfHandle, InfSectionName, AlternatePlatformInfo, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension, Reserved)
    
    DECLARE FUNCTION SetupEnumInfSectionsW LIB "SETUPAPI.DLL" ALIAS "SetupEnumInfSectionsW" (BYVAL InfHandle AS HINF, _
                                                                                             BYVAL Index AS DWORD, _
                                                                                             BYREF Buffer AS ANY, _
                                                                                             BYVAL SIZE AS DWORD, _
                                                                                             BYREF SizeNeeded AS DWORD) AS LONG
    MACRO SetupEnumInfSections(InfHandle, Index, Buffer, SIZE, SizeNeeded) = SetupEnumInfSectionsW(InfHandle, Index, Buffer, SIZE, SizeNeeded)
    
    DECLARE FUNCTION SetupVerifyInfFileW LIB "SETUPAPI.DLL" ALIAS "SetupVerifyInfFileW" (BYREF InfName AS ANY, _
                                                                                         BYREF AltPlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                         BYREF InfSignerInfo AS SP_INF_SIGNER_INFO_W) AS LONG
    MACRO SetupVerifyInfFile(InfName, AltPlatformInfo, InfSignerInfo) = SetupVerifyInfFileW(InfName, AltPlatformInfo, InfSignerInfo)
    
    DECLARE FUNCTION SetupDiGetCustomDevicePropertyW LIB "SETUPAPI.DLL" ALIAS "SetupDiGetCustomDevicePropertyW" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                 BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                 BYREF CustomPropertyName AS ANY, _
                                                                                                                 BYVAL Flags AS DWORD, _
                                                                                                                 BYREF PropertyRegDataType AS DWORD, _
                                                                                                                 BYREF PropertyBuffer AS ANY, _
                                                                                                                 BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                 BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetCustomDeviceProperty(DeviceInfoSet, DeviceInfoData, CustomPropertyName, Flags, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize) = _
    SetupDiGetCustomDevicePropertyW(DeviceInfoSet, DeviceInfoData, CustomPropertyName, Flags, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupConfigureWmiFromInfSectionW LIB "SETUPAPI.DLL" ALIAS "SetupConfigureWmiFromInfSectionW" (BYVAL InfHandle AS HINF, _
                                                                                                                   BYREF SectionName AS ANY, _
                                                                                                                   BYVAL Flags AS DWORD) AS LONG
    MACRO SetupConfigureWmiFromInfSection(InfHandle, SectionName, Flags) = SetupConfigureWmiFromInfSectionW(InfHandle, SectionName, Flags)
    
    
    #ELSE ' ANSI specific function declarations...
    
    
    DECLARE FUNCTION SetupGetInfInformationA LIB "SETUPAPI.DLL" ALIAS "SetupGetInfInformationA" (BYREF InfSpec AS ANY, _
                                                                                                 BYVAL SearchControl AS DWORD, _
                                                                                                 BYREF ReturnBuffer AS SP_INF_INFORMATION, _
                                                                                                 BYVAL ReturnBufferSize AS DWORD, _
                                                                                                 BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetInfInformation(InfSpec, SearchControl, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetInfInformationA(InfSpec, SearchControl, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQueryInfFileInformationA LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfFileInformationA" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                             BYVAL InfIndex AS DWORD, _
                                                                                                             BYREF ReturnBuffer AS ASCIIZ, _
                                                                                                             BYVAL ReturnBufferSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryInfFileInformation(InfInformation, InfIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryInfFileInformationA(InfInformation, InfIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQueryInfOriginalFileInformationA LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfOriginalFileInformationA" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                                             BYVAL InfIndex AS DWORD, _
                                                                                                                             BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                             BYREF OriginalFileInfo AS SP_ORIGINAL_FILE_INFO_A) AS LONG
    MACRO SetupQueryInfOriginalFileInformation(InfInformation, InfIndex, AlternatePlatformInfo, OriginalFileInfo) = SetupQueryInfOriginalFileInformationA(InfInformation, InfIndex, AlternatePlatformInfo, OriginalFileInfo)
    
    DECLARE FUNCTION SetupQueryInfVersionInformationA LIB "SETUPAPI.DLL" ALIAS "SetupQueryInfVersionInformationA" (BYREF InfInformation AS SP_INF_INFORMATION, _
                                                                                                                   BYVAL InfIndex AS DWORD, _
                                                                                                                   BYREF Key AS ASCIIZ, _
                                                                                                                   BYREF ReturnBuffer AS ASCIIZ, _
                                                                                                                   BYVAL ReturnBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryInfVersionInformation(InfInformation, InfIndex, Key, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryInfVersionInformationA(InfInformation, InfIndex, Key, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetInfFileListA LIB "SETUPAPI.DLL" ALIAS "SetupGetInfFileListA" (BYREF DirectoryPath AS ASCIIZ, _
                                                                                           BYVAL InfStyle AS DWORD, _
                                                                                           BYREF ReturnBuffer AS ASCIIZ, _
                                                                                           BYVAL ReturnBufferSize AS DWORD, _
                                                                                           BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetInfFileList(DirectoryPath, InfStyle, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetInfFileListA(DirectoryPath, InfStyle, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupOpenInfFileA LIB "SETUPAPI.DLL" ALIAS "SetupOpenInfFileA" (BYREF FileName AS ASCIIZ, _
                                                                                     BYREF InfClass AS ASCIIZ, _
                                                                                     BYVAL InfStyle AS DWORD, _
                                                                                     BYREF ErrorLine AS DWORD) AS HINF
    MACRO SetupOpenInfFile(FileName, InfClass, InfStyle, ErrorLine) = SetupOpenInfFileA(FileName, InfClass, InfStyle, ErrorLine)
    
    DECLARE FUNCTION SetupOpenAppendInfFileA LIB "SETUPAPI.DLL" ALIAS "SetupOpenAppendInfFileA" (BYREF FileName AS ASCIIZ, _
                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                 BYREF ErrorLine AS DWORD) AS LONG
    MACRO SetupOpenAppendInfFile(FileName, InfHandle, ErrorLine) = SetupOpenAppendInfFileA(FileName, InfHandle, ErrorLine)
    
    DECLARE FUNCTION SetupFindFirstLineA LIB "SETUPAPI.DLL" ALIAS "SetupFindFirstLineA" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF Section AS ASCIIZ, _
                                                                                         BYREF Key AS ASCIIZ, _
                                                                                         BYREF inContext AS INFCONTEXT) AS LONG
    MACRO SetupFindFirstLine(InfHandle, Section, Key, inContext) = SetupFindFirstLineA(InfHandle, Section, Key, inContext)
    
    DECLARE FUNCTION SetupFindNextMatchLineA LIB "SETUPAPI.DLL" ALIAS "SetupFindNextMatchLineA" (BYREF ContextIn AS INFCONTEXT, _
                                                                                                 BYREF Key AS ASCIIZ, _
                                                                                                 BYREF ContextOut AS INFCONTEXT) AS LONG
    MACRO SetupFindNextMatchLine(ContextIn, Key, ContextOut) = SetupFindNextMatchLineA(ContextIn, Key, ContextOut)
    
    DECLARE FUNCTION SetupGetLineByIndexA LIB "SETUPAPI.DLL" ALIAS "SetupGetLineByIndexA" (BYVAL InfHandle AS HINF, _
                                                                                           BYREF Section AS ASCIIZ, _
                                                                                           BYVAL Index AS DWORD, _
                                                                                           BYREF inContext AS INFCONTEXT) AS LONG
    MACRO SetupGetLineByIndex(InfHandle, Section, Index, inContext) = SetupGetLineByIndexA(InfHandle, Section, Index, inContext)
    
    DECLARE FUNCTION SetupGetLineCountA LIB "SETUPAPI.DLL" ALIAS "SetupGetLineCountA" (BYVAL InfHandle AS HINF, _
                                                                                       BYREF Section AS ASCIIZ) AS LONG
    MACRO SetupGetLineCount(InfHandle, Section) = SetupGetLineCountA(InfHandle, Section)
    
    DECLARE FUNCTION SetupGetLineTextA LIB "SETUPAPI.DLL" ALIAS "SetupGetLineTextA" (BYREF inContext AS INFCONTEXT, _
                                                                                     BYVAL InfHandle AS HINF, _
                                                                                     BYREF Section AS ASCIIZ, _
                                                                                     BYREF Key AS ASCIIZ, _
                                                                                     BYREF ReturnBuffer AS ASCIIZ, _
                                                                                     BYVAL ReturnBufferSize AS DWORD, _
                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetLineText(inContext, InfHandle, Section, Key, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetLineTextA(inContext, InfHandle, Section, Key, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetStringFieldA LIB "SETUPAPI.DLL" ALIAS "SetupGetStringFieldA" (BYREF inContext AS INFCONTEXT, _
                                                                                           BYVAL FieldIndex AS DWORD, _
                                                                                           BYREF ReturnBuffer AS ASCIIZ, _
                                                                                           BYVAL ReturnBufferSize AS DWORD, _
                                                                                           BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetStringField(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetStringFieldA(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetMultiSzFieldA LIB "SETUPAPI.DLL" ALIAS "SetupGetMultiSzFieldA" (BYREF inContext AS INFCONTEXT, _
                                                                                             BYVAL FieldIndex AS DWORD, _
                                                                                             BYREF ReturnBuffer AS ASCIIZ, _
                                                                                             BYVAL ReturnBufferSize AS DWORD, _
                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetMultiSzField(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetMultiSzFieldA(inContext, FieldIndex, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetFileCompressionInfoA LIB "SETUPAPI.DLL" ALIAS "SetupGetFileCompressionInfoA" (BYREF SourceFileName AS ASCIIZ, _
                                                                                                           BYREF ActualSourceFileName AS ASCIIZ, _
                                                                                                           BYREF SourceFileSize AS DWORD, _
                                                                                                           BYREF TargetFileSize AS DWORD, _
                                                                                                           BYREF CompressionType AS DWORD) AS DWORD
    MACRO SetupGetFileCompressionInfo(SourceFileName, ActualSourceFileName, SourceFileSize, TargetFileSize, CompressionType) = SetupGetFileCompressionInfoA(SourceFileName, ActualSourceFileName, SourceFileSize, TargetFileSize, CompressionType)
    
    DECLARE FUNCTION SetupGetFileCompressionInfoExA LIB "SETUPAPI.DLL" ALIAS "SetupGetFileCompressionInfoExA" (BYREF SourceFileName AS ASCIIZ, _
                                                                                                               BYREF ActualSourceFileNameBuffer AS ASCIIZ, _
                                                                                                               BYVAL ActualSourceFileNameBufferLen AS DWORD, _
                                                                                                               BYREF RequiredBufferLen AS DWORD, _
                                                                                                               BYREF SourceFileSize AS DWORD, _
                                                                                                               BYREF TargetFileSize AS DWORD, _
                                                                                                               BYREF CompressionType AS DWORD) AS LONG
    MACRO SetupGetFileCompressionInfoEx(SourceFileName, ActualSourceFileNameBuffer, ActualSourceFileNameBufferLen, RequiredBufferLen, SourceFileSize, TargetFileSize, CompressionType) = _
    SetupGetFileCompressionInfoExA(SourceFileName, ActualSourceFileNameBuffer, ActualSourceFileNameBufferLen, RequiredBufferLen, SourceFileSize, TargetFileSize, CompressionType)
    
    DECLARE FUNCTION SetupDecompressOrCopyFileA LIB "SETUPAPI.DLL" ALIAS "SetupDecompressOrCopyFileA" (BYREF SourceFileName AS ASCIIZ, _
                                                                                                       BYREF TargetFileName AS ASCIIZ, _
                                                                                                       BYREF CompressionType AS DWORD) AS DWORD
    MACRO SetupDecompressOrCopyFile(SourceFileName, TargetFileName, CompressionType) = SetupDecompressOrCopyFileA(SourceFileName, TargetFileName, CompressionType)
    
    DECLARE FUNCTION SetupGetSourceFileLocationA LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceFileLocationA" (BYVAL InfHandle AS HINF, _
                                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                                         BYREF FileName AS ASCIIZ, _
                                                                                                         BYREF SourceId AS DWORD, _
                                                                                                         BYREF ReturnBuffer AS ASCIIZ, _
                                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetSourceFileLocation(InfHandle, inContext, FileName, SourceId, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetSourceFileLocationA(InfHandle, inContext, FileName, SourceId, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupGetSourceFileSizeA LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceFileSizeA" (BYVAL InfHandle AS HINF, _
                                                                                                 BYREF inContext AS INFCONTEXT, _
                                                                                                 BYREF FileName AS ASCIIZ, _
                                                                                                 BYREF Section AS ASCIIZ, _
                                                                                                 BYREF FileSize AS DWORD, _
                                                                                                 BYVAL RoundingFactor AS DWORD) AS LONG
    MACRO SetupGetSourceFileSize(InfHandle, inContext, FileName, Section, FileSize, RoundingFactor) = SetupGetSourceFileSizeA(InfHandle, inContext, FileName, Section, FileSize, RoundingFactor)
    
    DECLARE FUNCTION SetupGetTargetPathA LIB "SETUPAPI.DLL" ALIAS "SetupGetTargetPathA" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                         BYREF Section AS ASCIIZ, _
                                                                                         BYREF ReturnBuffer AS ASCIIZ, _
                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetTargetPath(InfHandle, inContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetTargetPathA(InfHandle, inContext, Section, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupSetSourceListA LIB "SETUPAPI.DLL" ALIAS "SetupSetSourceListA" (BYVAL Flags AS DWORD, _
                                                                                         BYREF SourceList AS ASCIIZ, _
                                                                                         BYVAL SourceCount AS DWORD) AS LONG
    MACRO SetupSetSourceList(Flags, SourceList, SourceCount) = SetupSetSourceListA(Flags, SourceList, SourceCount)
    
    DECLARE FUNCTION SetupAddToSourceListA LIB "SETUPAPI.DLL" ALIAS "SetupAddToSourceListA" (BYVAL Flags AS DWORD, _
                                                                                             BYREF Source AS ASCIIZ) AS LONG
    MACRO SetupAddToSourceList(Flags, Source) = SetupAddToSourceListA(Flags, Source)
    
    DECLARE FUNCTION SetupRemoveFromSourceListA LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFromSourceListA" (BYVAL Flags AS DWORD, _
                                                                                                       BYREF Source AS ASCIIZ) AS LONG
    MACRO SetupRemoveFromSourceList(Flags, Source) = SetupRemoveFromSourceListA(Flags, Source)
    
    DECLARE FUNCTION SetupQuerySourceListA LIB "SETUPAPI.DLL" ALIAS "SetupQuerySourceListA" (BYVAL Flags AS DWORD, _
                                                                                             BYREF List AS ASCIIZ, _
                                                                                             BYREF Count AS DWORD) AS LONG
    MACRO SetupQuerySourceList(Flags, List, Count) = SetupQuerySourceListA(Flags, List, Count)
    
    DECLARE FUNCTION SetupFreeSourceListA LIB "SETUPAPI.DLL" ALIAS "SetupFreeSourceListA" (BYREF List AS ANY, _
                                                                                           BYVAL Count AS DWORD) AS LONG
    MACRO SetupFreeSourceList(List, Count) = SetupFreeSourceListA(List, Count)
    
    DECLARE FUNCTION SetupPromptForDiskA LIB "SETUPAPI.DLL" ALIAS "SetupPromptForDiskA" (BYVAL hwndParent AS DWORD, _
                                                                                         BYREF DialogTitle AS ASCIIZ, _
                                                                                         BYREF DiskName AS ASCIIZ, _
                                                                                         BYREF PathToSource AS ASCIIZ, _
                                                                                         BYREF FileSought AS ASCIIZ, _
                                                                                         BYREF TagFile AS ASCIIZ, _
                                                                                         BYVAL DiskPromptStyle AS DWORD, _
                                                                                         BYREF PathBuffer AS ASCIIZ, _
                                                                                         BYVAL PathBufferSize AS DWORD, _
                                                                                         BYREF PathRequiredSize AS DWORD) AS DWORD
    MACRO SetupPromptForDisk(hwndParent, DialogTitle, DiskName, PathToSource, FileSought, TagFile, DiskPromptStyle, PathBuffer, PathBufferSize, PathRequiredSize) = _
    SetupPromptForDiskA(hwndParent, DialogTitle, DiskName, PathToSource, FileSought, TagFile, DiskPromptStyle, PathBuffer, PathBufferSize, PathRequiredSize)
    
    DECLARE FUNCTION SetupCopyErrorA LIB "SETUPAPI.DLL" ALIAS "SetupCopyErrorA" (BYVAL hwndParent AS DWORD, _
                                                                                 BYREF DialogTitle AS ASCIIZ, _
                                                                                 BYREF DiskName AS ASCIIZ, _
                                                                                 BYREF PathToSource AS ASCIIZ, _
                                                                                 BYREF SourceFile AS ASCIIZ, _
                                                                                 BYREF TargetPathFile AS ASCIIZ, _
                                                                                 BYVAL Win32ErrorCode AS DWORD, _
                                                                                 BYVAL STYLE AS DWORD, _
                                                                                 BYREF PathBuffer AS ASCIIZ, _
                                                                                 BYVAL PathBufferSize AS DWORD, _
                                                                                 BYREF PathRequiredSize AS DWORD) AS DWORD
    MACRO SetupCopyError(hwndParent, DialogTitle, DiskName, PathToSource, SourceFile, TargetPathFile, Win32ErrorCode, STYLE, PathBuffer, PathBufferSize, PathRequiredSize) = _
    SetupCopyErrorA(hwndParent, DialogTitle, DiskName, PathToSource, SourceFile, TargetPathFile, Win32ErrorCode, STYLE, PathBuffer, PathBufferSize, PathRequiredSize)
    
    DECLARE FUNCTION SetupRenameErrorA LIB "SETUPAPI.DLL" ALIAS "SetupRenameErrorA" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ASCIIZ, _
                                                                                     BYREF SourceFile AS ASCIIZ, _
                                                                                     BYREF TargetFile AS ASCIIZ, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupRenameError(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE) = SetupRenameErrorA(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupDeleteErrorA LIB "SETUPAPI.DLL" ALIAS "SetupDeleteErrorA" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ASCIIZ, _
                                                                                     BYREF File AS ASCIIZ, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupDeleteError(hwndParent, DialogTitle, File, Win32ErrorCode, STYLE) = SetupDeleteErrorA(hwndParent, DialogTitle, File, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupBackupErrorA LIB "SETUPAPI.DLL" ALIAS "SetupBackupErrorA" (BYVAL hwndParent AS DWORD, _
                                                                                     BYREF DialogTitle AS ASCIIZ, _
                                                                                     BYREF SourceFile AS ASCIIZ, _
                                                                                     BYREF TargetFile AS ASCIIZ, _
                                                                                     BYVAL Win32ErrorCode AS DWORD, _
                                                                                     BYVAL STYLE AS DWORD) AS DWORD
    MACRO SetupBackupError(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE) = SetupBackupErrorA(hwndParent, DialogTitle, SourceFile, TargetFile, Win32ErrorCode, STYLE)
    
    DECLARE FUNCTION SetupSetDirectoryIdA LIB "SETUPAPI.DLL" ALIAS "SetupSetDirectoryIdA" (BYVAL InfHandle AS HINF, _
                                                                                           BYVAL Id AS DWORD, _
                                                                                           BYREF Directory AS ASCIIZ) AS LONG
    MACRO SetupSetDirectoryId(InfHandle, Id, Directory) = SetupSetDirectoryIdA(InfHandle, Id, Directory)
    
    DECLARE FUNCTION SetupSetDirectoryIdExA LIB "SETUPAPI.DLL" ALIAS "SetupSetDirectoryIdExA" (BYVAL InfHandle AS HINF, _
                                                                                               BYVAL Id AS DWORD, _
                                                                                               BYREF Directory AS ASCIIZ, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL Reserved1 AS DWORD, _
                                                                                               BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupSetDirectoryIdEx(InfHandle, Id, Directory, Flags, Reserved1, Reserved2) = SetupSetDirectoryIdExA(InfHandle, Id, Directory, Flags, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupGetSourceInfoA LIB "SETUPAPI.DLL" ALIAS "SetupGetSourceInfoA" (BYVAL InfHandle AS HINF, _
                                                                                         BYVAL SourceId AS DWORD, _
                                                                                         BYVAL InfoDesired AS DWORD, _
                                                                                         BYREF ReturnBuffer AS ASCIIZ, _
                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupGetSourceInfo(InfHandle, SourceId, InfoDesired, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupGetSourceInfoA(InfHandle, SourceId, InfoDesired, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupInstallFileA LIB "SETUPAPI.DLL" ALIAS "SetupInstallFileA" (BYVAL InfHandle AS HINF, _
                                                                                     BYREF inContext AS INFCONTEXT, _
                                                                                     BYREF SourceFile AS ASCIIZ, _
                                                                                     BYREF SourcePathRoot AS ASCIIZ, _
                                                                                     BYREF DestinationName AS ASCIIZ, _
                                                                                     BYVAL CopyStyle AS DWORD, _
                                                                                     BYVAL CopyMsgHandler AS DWORD, _
                                                                                     BYREF inContext AS ANY) AS LONG
    MACRO SetupInstallFile(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext) = SetupInstallFileA(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext)
    
    DECLARE FUNCTION SetupInstallFileExA LIB "SETUPAPI.DLL" ALIAS "SetupInstallFileExA" (BYVAL InfHandle AS HINF, _
                                                                                         BYREF inContext AS INFCONTEXT, _
                                                                                         BYREF SourceFile AS ASCIIZ, _
                                                                                         BYREF SourcePathRoot AS ASCIIZ, _
                                                                                         BYREF DestinationName AS ASCIIZ, _
                                                                                         BYVAL CopyStyle AS DWORD, _
                                                                                         BYVAL CopyMsgHandler AS DWORD, _
                                                                                         BYREF inContext AS ANY, _
                                                                                         BYREF FileWasInUse AS LONG) AS LONG
    MACRO SetupInstallFileEx(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext, FileWasInUse) = _
    SetupInstallFileExA(InfHandle, inContext, SourceFile, SourcePathRoot, DestinationName, CopyStyle, CopyMsgHandler, inContext, FileWasInUse)
    
    DECLARE FUNCTION SetupSetFileQueueAlternatePlatformA LIB "SETUPAPI.DLL" ALIAS "SetupSetFileQueueAlternatePlatformA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                                         BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                         BYREF AlternateDefaultCatalogFile AS ASCIIZ) AS LONG
    MACRO SetupSetFileQueueAlternatePlatform(QueueHandle, AlternatePlatformInfo, AlternateDefaultCatalogFile) = SetupSetFileQueueAlternatePlatformA(QueueHandle, AlternatePlatformInfo, AlternateDefaultCatalogFile)
    
    DECLARE FUNCTION SetupSetPlatformPathOverrideA LIB "SETUPAPI.DLL" ALIAS "SetupSetPlatformPathOverrideA" (BYREF Override AS ASCIIZ) AS LONG
    MACRO SetupSetPlatformPathOverride(Override) = SetupSetPlatformPathOverrideA(Override)
    
    DECLARE FUNCTION SetupQueueCopyA LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopyA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                 BYREF SourceRootPath AS ASCIIZ, _
                                                                                 BYREF SourcePath AS ASCIIZ, _
                                                                                 BYREF SourceFilename AS ASCIIZ, _
                                                                                 BYREF SourceDescription AS ASCIIZ, _
                                                                                 BYREF SourceTagfile AS ASCIIZ, _
                                                                                 BYREF TargetDirectory AS ASCIIZ, _
                                                                                 BYREF TargetFilename AS ASCIIZ, _
                                                                                 BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueCopy(QueueHandle, SourceRootPath, SourcePath, SourceFilename, SourceDescription, SourceTagfile, TargetDirectory, TargetFilename, CopyStyle) = _
    SetupQueueCopyA(QueueHandle, SourceRootPath, SourcePath, SourceFilename, SourceDescription, SourceTagfile, TargetDirectory, TargetFilename, CopyStyle)
    
    DECLARE FUNCTION SetupQueueCopyIndirectA LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopyIndirectA" (BYREF CopyParams AS SP_FILE_COPY_PARAMS_A) AS LONG
    MACRO SetupQueueCopyIndirect(CopyParams) = SetupQueueCopyIndirectA(CopyParams)
    
    DECLARE FUNCTION SetupQueueDefaultCopyA LIB "SETUPAPI.DLL" ALIAS "SetupQueueDefaultCopyA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                               BYVAL InfHandle AS HINF, _
                                                                                               BYREF SourceRootPath AS ASCIIZ, _
                                                                                               BYREF SourceFilename AS ASCIIZ, _
                                                                                               BYREF TargetFilename AS ASCIIZ, _
                                                                                               BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueDefaultCopy(QueueHandle, InfHandle, SourceRootPath, SourceFilename, TargetFilename, CopyStyle) = SetupQueueDefaultCopyA(QueueHandle, InfHandle, SourceRootPath, SourceFilename, TargetFilename, CopyStyle)
    
    DECLARE FUNCTION SetupQueueCopySectionA LIB "SETUPAPI.DLL" ALIAS "SetupQueueCopySectionA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                               BYREF SourceRootPath AS ASCIIZ, _
                                                                                               BYVAL InfHandle AS HINF, _
                                                                                               BYVAL ListInfHandle AS HINF, _
                                                                                               BYREF Section AS ASCIIZ, _
                                                                                               BYVAL CopyStyle AS DWORD) AS LONG
    MACRO SetupQueueCopySection(QueueHandle, SourceRootPath, InfHandle, ListInfHandle, Section, CopyStyle) = SetupQueueCopySectionA(QueueHandle, SourceRootPath, InfHandle, ListInfHandle, Section, CopyStyle)
    
    DECLARE FUNCTION SetupQueueDeleteA LIB "SETUPAPI.DLL" ALIAS "SetupQueueDeleteA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                     BYREF PathPart1 AS ASCIIZ, _
                                                                                     BYREF PathPart2 AS ASCIIZ) AS LONG
    MACRO SetupQueueDelete(QueueHandle, PathPart1, PathPart2) = SetupQueueDeleteA(QueueHandle, PathPart1, PathPart2)
    
    DECLARE FUNCTION SetupQueueDeleteSectionA LIB "SETUPAPI.DLL" ALIAS "SetupQueueDeleteSectionA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                   BYVAL InfHandle AS HINF, _
                                                                                                   BYVAL ListInfHandle AS HINF, _
                                                                                                   BYREF Section AS ASCIIZ) AS LONG
    MACRO SetupQueueDeleteSection(QueueHandle, InfHandle, ListInfHandle, Section) = SetupQueueDeleteSectionA(QueueHandle, InfHandle, ListInfHandle, Section)
    
    DECLARE FUNCTION SetupQueueRenameA LIB "SETUPAPI.DLL" ALIAS "SetupQueueRenameA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                     BYREF SourcePath AS ASCIIZ, _
                                                                                     BYREF SourceFilename AS ASCIIZ, _
                                                                                     BYREF TargetPath AS ASCIIZ, _
                                                                                     BYREF TargetFilename AS ASCIIZ) AS LONG
    MACRO SetupQueueRename(QueueHandle, SourcePath, SourceFilename, TargetPath, TargetFilename) = SetupQueueRenameA(QueueHandle, SourcePath, SourceFilename, TargetPath, TargetFilename)
    
    DECLARE FUNCTION SetupQueueRenameSectionA LIB "SETUPAPI.DLL" ALIAS "SetupQueueRenameSectionA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                   BYVAL InfHandle AS HINF, _
                                                                                                   BYVAL ListInfHandle AS HINF, _
                                                                                                   BYREF Section AS ASCIIZ) AS LONG
    MACRO SetupQueueRenameSection(QueueHandle, InfHandle, ListInfHandle, Section) = SetupQueueRenameSectionA(QueueHandle, InfHandle, ListInfHandle, Section)
    
    DECLARE FUNCTION SetupCommitFileQueueA LIB "SETUPAPI.DLL" ALIAS "SetupCommitFileQueueA" (BYVAL Owner AS DWORD, _
                                                                                             BYVAL QueueHandle AS HSPFILEQ, _
                                                                                             BYVAL MsgHandler AS DWORD, _
                                                                                             BYREF inContext AS ANY) AS LONG
    MACRO SetupCommitFileQueue(Owner, QueueHandle, MsgHandler, inContext) = SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, inContext)
    
    DECLARE FUNCTION SetupScanFileQueueA LIB "SETUPAPI.DLL" ALIAS "SetupScanFileQueueA" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                         BYVAL Flags AS DWORD, _
                                                                                         BYVAL WINDOW AS DWORD, _
                                                                                         BYVAL CallbackRoutine AS DWORD, _
                                                                                         BYREF CallbackContext AS ANY, _
                                                                                         BYREF Result AS DWORD) AS LONG
    MACRO SetupScanFileQueue(FileQueue, Flags, WINDOW, CallbackRoutine, CallbackContext, Result) = SetupScanFileQueueA(FileQueue, Flags, WINDOW, CallbackRoutine, CallbackContext, Result)
    
    DECLARE FUNCTION SetupCopyOEMInfA LIB "SETUPAPI.DLL" ALIAS "SetupCopyOEMInfA" (BYREF SourceInfFileName AS ASCIIZ, _
                                                                                   BYREF OEMSourceMediaLocation AS ASCIIZ, _
                                                                                   BYVAL OEMSourceMediaType AS DWORD, _
                                                                                   BYVAL CopyStyle AS DWORD, _
                                                                                   BYREF DestinationInfFileName AS ASCIIZ, _
                                                                                   BYVAL DestinationInfFileNameSize AS DWORD, _
                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                   BYREF DestinationInfFileNameComponent AS ASCIIZ) AS LONG
    MACRO SetupCopyOEMInf(SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType, CopyStyle, DestinationInfFileName, DestinationInfFileNameSize, RequiredSize, DestinationInfFileNameComponent) = _
    SetupCopyOEMInfA(SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType, CopyStyle, DestinationInfFileName, DestinationInfFileNameSize, RequiredSize, DestinationInfFileNameComponent)
    
    DECLARE FUNCTION SetupUninstallOEMInfA LIB "SETUPAPI.DLL" ALIAS "SetupUninstallOEMInfA" (BYREF InfFileName AS ASCIIZ, _
                                                                                             BYVAL Flags AS DWORD, _
                                                                                             BYREF Reserved AS ANY) AS LONG
    MACRO SetupUninstallOEMInf(InfFileName, Flags, Reserved) = SetupUninstallOEMInfA(InfFileName, Flags, Reserved)
    
    DECLARE FUNCTION SetupCreateDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupCreateDiskSpaceListA" (BYREF Reserved1 AS ANY, _
                                                                                                     BYVAL Reserved2 AS DWORD, _
                                                                                                     BYVAL Flags AS DWORD) AS HDSKSPC
    MACRO SetupCreateDiskSpaceList(Reserved1, Reserved2, Flags) = SetupCreateDiskSpaceListA(Reserved1, Reserved2, Flags)
    
    DECLARE FUNCTION SetupDuplicateDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupDuplicateDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                           BYREF Reserved1 AS ANY, _
                                                                                                           BYVAL Reserved2 AS DWORD, _
                                                                                                           BYVAL Flags AS DWORD) AS HDSKSPC
    MACRO SetupDuplicateDiskSpaceList(DiskSpace, Reserved1, Reserved2, Flags) = SetupDuplicateDiskSpaceListA(DiskSpace, Reserved1, Reserved2, Flags)
    
    DECLARE FUNCTION SetupQueryDrivesInDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupQueryDrivesInDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                   BYREF ReturnBuffer AS ASCIIZ, _
                                                                                                                   BYVAL ReturnBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryDrivesInDiskSpaceList(DiskSpace, ReturnBuffer, ReturnBufferSize, RequiredSize) = SetupQueryDrivesInDiskSpaceListA(DiskSpace, ReturnBuffer, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupQuerySpaceRequiredOnDriveA LIB "SETUPAPI.DLL" ALIAS "SetupQuerySpaceRequiredOnDriveA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                 BYREF DriveSpec AS ASCIIZ, _
                                                                                                                 BYREF SpaceRequired AS QUAD, _
                                                                                                                 BYREF Reserved1 AS ANY, _
                                                                                                                 BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupQuerySpaceRequiredOnDrive(DiskSpace, DriveSpec, SpaceRequired, Reserved1, Reserved2) = SetupQuerySpaceRequiredOnDriveA(DiskSpace, DriveSpec, SpaceRequired, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAdjustDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupAdjustDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                     BYREF DriveRoot AS ASCIIZ, _
                                                                                                     BYVAL Amount AS QUAD, _
                                                                                                     BYREF Reserved1 AS ANY, _
                                                                                                     BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAdjustDiskSpaceList(DiskSpace, DriveRoot, Amount, Reserved1, Reserved2) = SetupAdjustDiskSpaceListA(DiskSpace, DriveRoot, Amount, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddToDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupAddToDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                   BYREF TargetFilespec AS ASCIIZ, _
                                                                                                   BYVAL FileSize AS QUAD, _
                                                                                                   BYVAL Operation AS DWORD, _
                                                                                                   BYREF Reserved1 AS ANY, _
                                                                                                   BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddToDiskSpaceList(DiskSpace, TargetFilespec, FileSize, Operation, Reserved1, Reserved2) = SetupAddToDiskSpaceListA(DiskSpace, TargetFilespec, FileSize, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddSectionToDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupAddSectionToDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                                 BYVAL ListInfHandle AS HINF, _
                                                                                                                 BYREF SectionName AS ASCIIZ, _
                                                                                                                 BYVAL Operation AS DWORD, _
                                                                                                                 BYREF Reserved1 AS ANY, _
                                                                                                                 BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddSectionToDiskSpaceList(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2) = SetupAddSectionToDiskSpaceListA(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupAddInstallSectionToDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupAddInstallSectionToDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                               BYVAL InfHandle AS HINF, _
                                                                                                                               BYVAL LayoutInfHandle AS HINF, _
                                                                                                                               BYREF SectionName AS ASCIIZ, _
                                                                                                                               BYREF Reserved1 AS ANY, _
                                                                                                                               BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupAddInstallSectionToDiskSpaceList(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2) = SetupAddInstallSectionToDiskSpaceListA(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveFromDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFromDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                             BYREF TargetFilespec AS ASCIIZ, _
                                                                                                             BYVAL Operation AS DWORD, _
                                                                                                             BYREF Reserved1 AS ANY, _
                                                                                                             BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveFromDiskSpaceList(DiskSpace, TargetFilespec, Operation, Reserved1, Reserved2) = SetupRemoveFromDiskSpaceListA(DiskSpace, TargetFilespec, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveSectionFromDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupRemoveSectionFromDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                           BYVAL InfHandle AS HINF, _
                                                                                                                           BYVAL ListInfHandle AS HINF, _
                                                                                                                           BYREF SectionName AS ASCIIZ, _
                                                                                                                           BYVAL Operation AS DWORD, _
                                                                                                                           BYREF Reserved1 AS ANY, _
                                                                                                                           BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveSectionFromDiskSpaceList(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2) = SetupRemoveSectionFromDiskSpaceListA(DiskSpace, InfHandle, ListInfHandle, SectionName, Operation, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupRemoveInstallSectionFromDiskSpaceListA LIB "SETUPAPI.DLL" ALIAS "SetupRemoveInstallSectionFromDiskSpaceListA" (BYVAL DiskSpace AS HDSKSPC, _
                                                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                                                         BYVAL LayoutInfHandle AS HINF, _
                                                                                                                                         BYREF SectionName AS ASCIIZ, _
                                                                                                                                         BYREF Reserved1 AS ANY, _
                                                                                                                                         BYVAL Reserved2 AS DWORD) AS LONG
    MACRO SetupRemoveInstallSectionFromDiskSpaceList(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2) = SetupRemoveInstallSectionFromDiskSpaceListA(DiskSpace, InfHandle, LayoutInfHandle, SectionName, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupIterateCabinetA LIB "SETUPAPI.DLL" ALIAS "SetupIterateCabinetA" (BYREF CabinetFile AS ASCIIZ, _
                                                                                           BYVAL Reserved AS DWORD, _
                                                                                           BYVAL MsgHandler AS DWORD, _
                                                                                           BYREF inContext AS ANY) AS LONG
    MACRO SetupIterateCabinet(CabinetFile, Reserved, MsgHandler, inContext) = SetupIterateCabinetA(CabinetFile, Reserved, MsgHandler, inContext)
    
    DECLARE FUNCTION SetupDefaultQueueCallbackA LIB "SETUPAPI.DLL" ALIAS "SetupDefaultQueueCallbackA" (BYREF inContext AS ANY, _
                                                                                                       BYVAL Notification AS DWORD, _
                                                                                                       BYREF Param1 AS DWORD, _
                                                                                                       BYREF Param2 AS DWORD) AS DWORD
    MACRO SetupDefaultQueueCallback(inContext, Notification, Param1, Param2) = SetupDefaultQueueCallbackA(inContext, Notification, Param1, Param2)
    
    DECLARE FUNCTION SetupInstallFromInfSectionA LIB "SETUPAPI.DLL" ALIAS "SetupInstallFromInfSectionA" (BYVAL Owner AS DWORD, _
                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                         BYREF SectionName AS ASCIIZ, _
                                                                                                         BYVAL Flags AS DWORD, _
                                                                                                         BYVAL RelativeKeyRoot AS DWORD, _
                                                                                                         BYREF SourceRootPath AS ASCIIZ, _
                                                                                                         BYVAL CopyFlags AS DWORD, _
                                                                                                         BYVAL MsgHandler AS DWORD, _
                                                                                                         BYREF inContext AS ANY, _
                                                                                                         BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF PSP_DEVINFO_DATA AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupInstallFromInfSection(Owner, InfHandle, SectionName, Flags, RelativeKeyRoot, SourceRootPath, CopyFlags, MsgHandler, inContext, DeviceInfoSet, PSP_DEVINFO_DATA) = _
    SetupInstallFromInfSectionA(Owner, InfHandle, SectionName, Flags, RelativeKeyRoot, SourceRootPath, CopyFlags, MsgHandler, inContext, DeviceInfoSet, PSP_DEVINFO_DATA)
    
    DECLARE FUNCTION SetupInstallFilesFromInfSectionA LIB "SETUPAPI.DLL" ALIAS "SetupInstallFilesFromInfSectionA" (BYVAL InfHandle AS HINF, _
                                                                                                                   BYVAL LayoutInfHandle AS HINF, _
                                                                                                                   BYVAL FileQueue AS HSPFILEQ, _
                                                                                                                   BYREF SectionName AS ASCIIZ, _
                                                                                                                   BYREF SourceRootPath AS ASCIIZ, _
                                                                                                                   BYVAL CopyFlags AS DWORD) AS LONG
    MACRO SetupInstallFilesFromInfSection(InfHandle, LayoutInfHandle, FileQueue, SectionName, SourceRootPath, CopyFlags) = SetupInstallFilesFromInfSectionA(InfHandle, LayoutInfHandle, FileQueue, SectionName, SourceRootPath, CopyFlags)
    
    DECLARE FUNCTION SetupInstallServicesFromInfSectionA LIB "SETUPAPI.DLL" ALIAS "SetupInstallServicesFromInfSectionA" (BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF SectionName AS ASCIIZ, _
                                                                                                                         BYVAL Flags AS DWORD) AS LONG
    MACRO SetupInstallServicesFromInfSection(InfHandle, SectionName, Flags) = SetupInstallServicesFromInfSectionA(InfHandle, SectionName, Flags)
    
    DECLARE FUNCTION SetupInstallServicesFromInfSectionExA LIB "SETUPAPI.DLL" ALIAS "SetupInstallServicesFromInfSectionExA" (BYVAL InfHandle AS HINF, _
                                                                                                                             BYREF SectionName AS ASCIIZ, _
                                                                                                                             BYVAL Flags AS DWORD, _
                                                                                                                             BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                             BYREF Reserved1 AS ANY, _
                                                                                                                             BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupInstallServicesFromInfSectionEx(InfHandle, SectionName, Flags, DeviceInfoSet, DeviceInfoData, Reserved1, Reserved2) = SetupInstallServicesFromInfSectionExA(InfHandle, SectionName, Flags, DeviceInfoSet, DeviceInfoData, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupLogFileA LIB "SETUPAPI.DLL" ALIAS "SetupLogFileA" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                             BYREF LogSectionName AS ASCIIZ, _
                                                                             BYREF SourceFilename AS ASCIIZ, _
                                                                             BYREF TargetFilename AS ASCIIZ, _
                                                                             BYVAL Checksum AS DWORD, _
                                                                             BYREF DiskTagfile AS ASCIIZ, _
                                                                             BYREF DiskDescription AS ASCIIZ, _
                                                                             BYREF OtherInfo AS ASCIIZ, _
                                                                             BYVAL Flags AS DWORD) AS LONG
    MACRO SetupLogFile(FileLogHandle, LogSectionName, SourceFilename, TargetFilename, Checksum, DiskTagfile, DiskDescription, OtherInfo, Flags) = _
    SetupLogFileA(FileLogHandle, LogSectionName, SourceFilename, TargetFilename, Checksum, DiskTagfile, DiskDescription, OtherInfo, Flags)
    
    DECLARE FUNCTION SetupRemoveFileLogEntryA LIB "SETUPAPI.DLL" ALIAS "SetupRemoveFileLogEntryA" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                                                   BYREF LogSectionName AS ASCIIZ, _
                                                                                                   BYREF TargetFilename AS ASCIIZ) AS LONG
    MACRO SetupRemoveFileLogEntry(FileLogHandle, LogSectionName, TargetFilename) = SetupRemoveFileLogEntryA(FileLogHandle, LogSectionName, TargetFilename)
    
    DECLARE FUNCTION SetupQueryFileLogA LIB "SETUPAPI.DLL" ALIAS "SetupQueryFileLogA" (BYVAL FileLogHandle AS HSPFILELOG, _
                                                                                       BYREF LogSectionName AS ASCIIZ, _
                                                                                       BYREF TargetFilename AS ASCIIZ, _
                                                                                       BYVAL DesiredInfo AS LONG, _
                                                                                       BYREF DataOut AS ASCIIZ, _
                                                                                       BYVAL ReturnBufferSize AS DWORD, _
                                                                                       BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupQueryFileLog(FileLogHandle, LogSectionName, TargetFilename, DesiredInfo, DataOut, ReturnBufferSize, RequiredSize) = SetupQueryFileLogA(FileLogHandle, LogSectionName, TargetFilename, DesiredInfo, DataOut, ReturnBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupLogErrorA LIB "SETUPAPI.DLL" ALIAS "SetupLogErrorA" (BYREF MessageString AS ASCIIZ, _
                                                                               BYVAL Severity AS LogSeverity) AS LONG
    MACRO SetupLogError(MessageString, Severity) = SetupLogErrorA(MessageString, Severity)
    
    DECLARE FUNCTION SetupGetBackupInformationA LIB "SETUPAPI.DLL" ALIAS "SetupGetBackupInformationA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                       BYREF BackupParams AS SP_BACKUP_QUEUE_PARAMS_A) AS LONG
    MACRO SetupGetBackupInformation(QueueHandle, BackupParams) = SetupGetBackupInformationA(QueueHandle, BackupParams)
    
    DECLARE FUNCTION SetupPrepareQueueForRestoreA LIB "SETUPAPI.DLL" ALIAS "SetupPrepareQueueForRestoreA" (BYVAL QueueHandle AS HSPFILEQ, _
                                                                                                           BYREF BackupPath AS ASCIIZ, _
                                                                                                           BYVAL RestoreFlags AS DWORD) AS LONG
    MACRO SetupPrepareQueueForRestore(QueueHandle, BackupPath, RestoreFlags) = SetupPrepareQueueForRestoreA(QueueHandle, BackupPath, RestoreFlags)
    
    DECLARE FUNCTION SetupDiCreateDeviceInfoListExA LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInfoListExA" (BYREF ClassGuid AS GUID, _
                                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                                               BYREF MachineName AS ASCIIZ, _
                                                                                                               BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiCreateDeviceInfoListEx(ClassGuid, hwndParent, MachineName, Reserved) = SetupDiCreateDeviceInfoListExA(ClassGuid, hwndParent, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceInfoListDetailA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInfoListDetailA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                 BYREF DeviceInfoSetDetailData AS SP_DEVINFO_LIST_DETAIL_DATA_A) AS LONG
    MACRO SetupDiGetDeviceInfoListDetail(DeviceInfoSet, DeviceInfoSetDetailData) = SetupDiGetDeviceInfoListDetailA(DeviceInfoSet, DeviceInfoSetDetailData)
    
    DECLARE FUNCTION SetupDiCreateDeviceInfoA LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInfoA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                   BYREF DeviceName AS ASCIIZ, _
                                                                                                   BYREF ClassGuid AS GUID, _
                                                                                                   BYREF DeviceDescription AS ASCIIZ, _
                                                                                                   BYVAL hwndParent AS DWORD, _
                                                                                                   BYVAL CreationFlags AS DWORD, _
                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiCreateDeviceInfo(DeviceInfoSet, DeviceName, ClassGuid, DeviceDescription, hwndParent, CreationFlags, DeviceInfoData) = SetupDiCreateDeviceInfoA(DeviceInfoSet, DeviceName, ClassGuid, DeviceDescription, hwndParent, CreationFlags, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiOpenDeviceInfoA LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDeviceInfoA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF DeviceInstanceId AS ASCIIZ, _
                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                               BYVAL OpenFlags AS DWORD, _
                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiOpenDeviceInfo(DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData) = SetupDiOpenDeviceInfoA(DeviceInfoSet, DeviceInstanceId, hwndParent, OpenFlags, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiGetDeviceInstanceIdA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInstanceIdA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                         BYREF DeviceInstanceId AS ASCIIZ, _
                                                                                                         BYVAL DeviceInstanceIdSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDeviceInstanceId(DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize) = SetupDiGetDeviceInstanceIdA(DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiCreateDeviceInterfaceA LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInterfaceA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF InterfaceClassGuid AS GUID, _
                                                                                                             BYREF ReferenceString AS ASCIIZ, _
                                                                                                             BYVAL CreationFlags AS DWORD, _
                                                                                                             BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    MACRO SetupDiCreateDeviceInterface(DeviceInfoSet, DeviceInfoData, InterfaceClassGuid, ReferenceString, CreationFlags, DeviceInterfaceData) = _
    SetupDiCreateDeviceInterfaceA(DeviceInfoSet, DeviceInfoData, InterfaceClassGuid, ReferenceString, CreationFlags, DeviceInterfaceData)
    
    DECLARE FUNCTION SetupDiOpenDeviceInterfaceA LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDeviceInterfaceA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DevicePath AS ASCIIZ, _
                                                                                                         BYVAL OpenFlags AS DWORD, _
                                                                                                         BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    MACRO SetupDiOpenDeviceInterface(DeviceInfoSet, DevicePath, OpenFlags, DeviceInterfaceData) = SetupDiOpenDeviceInterfaceA(DeviceInfoSet, DevicePath, OpenFlags, DeviceInterfaceData)
    
    DECLARE FUNCTION SetupDiGetDeviceInterfaceDetailA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInterfaceDetailA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                   BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                   BYREF DeviceInterfaceDetailData AS SP_DEVICE_INTERFACE_DETAIL_DATA_A, _
                                                                                                                   BYVAL DeviceInterfaceDetailDataSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    MACRO SetupDiGetDeviceInterfaceDetail(DeviceInfoSet, DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData) = _
    SetupDiGetDeviceInterfaceDetailA(DeviceInfoSet, DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData)
    
    DECLARE FUNCTION SetupDiEnumDriverInfoA LIB "SETUPAPI.DLL" ALIAS "SetupDiEnumDriverInfoA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                               BYVAL DriverType AS DWORD, _
                                                                                               BYVAL MemberIndex AS DWORD, _
                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_A) AS LONG
    MACRO SetupDiEnumDriverInfo(DeviceInfoSet, DeviceInfoData, DriverType, MemberIndex, DriverInfoData) = SetupDiEnumDriverInfoA(DeviceInfoSet, DeviceInfoData, DriverType, MemberIndex, DriverInfoData)
    
    DECLARE FUNCTION SetupDiGetSelectedDriverA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetSelectedDriverA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                     BYREF DriverInfoData AS SP_DRVINFO_DATA_A) AS LONG
    MACRO SetupDiGetSelectedDriver(DeviceInfoSet, DeviceInfoData, DriverInfoData) = SetupDiGetSelectedDriverA(DeviceInfoSet, DeviceInfoData, DriverInfoData)
    
    DECLARE FUNCTION SetupDiSetSelectedDriverA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetSelectedDriverA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                     BYREF DriverInfoData AS ANY) AS LONG
    MACRO SetupDiSetSelectedDriver(DeviceInfoSet, DeviceInfoData, DriverInfoData) = SetupDiSetSelectedDriverA(DeviceInfoSet, DeviceInfoData, DriverInfoData)
    
    DECLARE FUNCTION SetupDiGetDriverInfoDetailA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDriverInfoDetailA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                         BYREF DriverInfoData AS SP_DRVINFO_DATA_A, _
                                                                                                         BYREF DriverInfoDetailData AS SP_DRVINFO_DETAIL_DATA_A, _
                                                                                                         BYVAL DriverInfoDetailDataSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDriverInfoDetail(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, RequiredSize) = _
    SetupDiGetDriverInfoDetailA(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInfoDetailData, DriverInfoDetailDataSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassDevsA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevsA" (BYREF ClassGuid AS GUID, _
                                                                                           BYREF Enumerator AS ASCIIZ, _
                                                                                           BYVAL hwndParent AS DWORD, _
                                                                                           BYVAL Flags AS DWORD) AS DWORD
    MACRO SetupDiGetClassDevs(ClassGuid, Enumerator, hwndParent, Flags) = SetupDiGetClassDevsA(ClassGuid, Enumerator, hwndParent, Flags)
    
    DECLARE FUNCTION SetupDiGetClassDevsExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevsExA" (BYREF ClassGuid AS GUID, _
                                                                                               BYREF Enumerator AS ASCIIZ, _
                                                                                               BYVAL hwndParent AS DWORD, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF MachineName AS ASCIIZ, _
                                                                                               BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiGetClassDevsEx(ClassGuid, Enumerator, hwndParent, Flags, DeviceInfoSet, MachineName, Reserved) = SetupDiGetClassDevsExA(ClassGuid, Enumerator, hwndParent, Flags, DeviceInfoSet, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetINFClassA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetINFClassA" (BYREF InfName AS ASCIIZ, _
                                                                                         BYREF ClassGuid AS GUID, _
                                                                                         BYREF ClassName AS ASCIIZ, _
                                                                                         BYVAL ClassNameSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetINFClass(InfName, ClassGuid, ClassName, ClassNameSize, RequiredSize) = SetupDiGetINFClassA(InfName, ClassGuid, ClassName, ClassNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiBuildClassInfoListExA LIB "SETUPAPI.DLL" ALIAS "SetupDiBuildClassInfoListExA" (BYVAL Flags AS DWORD, _
                                                                                                           BYREF ClassGuidList AS GUID, _
                                                                                                           BYVAL ClassGuidListSize AS DWORD, _
                                                                                                           BYREF RequiredSize AS DWORD, _
                                                                                                           BYREF MachineName AS ASCIIZ, _
                                                                                                           BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiBuildClassInfoListEx(Flags, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved) = SetupDiBuildClassInfoListExA(Flags, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetClassDescriptionA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDescriptionA" (BYREF ClassGuid AS GUID, _
                                                                                                         BYREF ClassDescription AS ASCIIZ, _
                                                                                                         BYVAL ClassDescriptionSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetClassDescription(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize) = SetupDiGetClassDescriptionA(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassDescriptionExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDescriptionExA" (BYREF ClassGuid AS GUID, _
                                                                                                             BYREF ClassDescription AS ASCIIZ, _
                                                                                                             BYVAL ClassDescriptionSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD, _
                                                                                                             BYREF MachineName AS ASCIIZ, _
                                                                                                             BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassDescriptionEx(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize, MachineName, Reserved) = SetupDiGetClassDescriptionExA(ClassGuid, ClassDescription, ClassDescriptionSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiInstallClassA LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallClassA" (BYVAL hwndParent AS DWORD, _
                                                                                           BYREF InfFileName AS ASCIIZ, _
                                                                                           BYVAL Flags AS DWORD, _
                                                                                           BYVAL FileQueue AS HSPFILEQ) AS LONG
    MACRO SetupDiInstallClass(hwndParent, InfFileName, Flags, FileQueue) = SetupDiInstallClassA(hwndParent, InfFileName, Flags, FileQueue)
    
    DECLARE FUNCTION SetupDiInstallClassExA LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallClassExA" (BYVAL hwndParent AS DWORD, _
                                                                                               BYREF InfFileName AS ASCIIZ, _
                                                                                               BYVAL Flags AS DWORD, _
                                                                                               BYVAL FileQueue AS HSPFILEQ, _
                                                                                               BYREF InterfaceClassGuid AS GUID, _
                                                                                               BYREF Reserved1 AS ANY, _
                                                                                               BYREF Reserved2 AS ANY) AS LONG
    MACRO SetupDiInstallClassEx(hwndParent, InfFileName, Flags, FileQueue, InterfaceClassGuid, Reserved1, Reserved2) = SetupDiInstallClassExA(hwndParent, InfFileName, Flags, FileQueue, InterfaceClassGuid, Reserved1, Reserved2)
    
    DECLARE FUNCTION SetupDiOpenClassRegKeyExA LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenClassRegKeyExA" (BYREF ClassGuid AS GUID, _
                                                                                                     BYVAL samDesired AS DWORD, _
                                                                                                     BYVAL Flags AS DWORD, _
                                                                                                     BYREF MachineName AS ASCIIZ, _
                                                                                                     BYREF Reserved AS ANY) AS DWORD
    MACRO SetupDiOpenClassRegKeyEx(ClassGuid, samDesired, Flags, MachineName, Reserved) = SetupDiOpenClassRegKeyExA(ClassGuid, samDesired, Flags, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiCreateDeviceInterfaceRegKeyA LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInterfaceRegKeyA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                         BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                         BYVAL Reserved AS DWORD, _
                                                                                                                         BYVAL samDesired AS DWORD, _
                                                                                                                         BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF InfSectionName AS ASCIIZ) AS DWORD
    MACRO SetupDiCreateDeviceInterfaceRegKey(DeviceInfoSet, DeviceInterfaceData, Reserved, samDesired, InfHandle, InfSectionName) = SetupDiCreateDeviceInterfaceRegKeyA(DeviceInfoSet, DeviceInterfaceData, Reserved, samDesired, InfHandle, InfSectionName)
    
    DECLARE FUNCTION SetupDiCreateDevRegKeyA LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDevRegKeyA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                 BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                 BYVAL Scope AS DWORD, _
                                                                                                 BYVAL HwProfile AS DWORD, _
                                                                                                 BYVAL KeyType AS DWORD, _
                                                                                                 BYVAL InfHandle AS HINF, _
                                                                                                 BYREF InfSectionName AS ASCIIZ) AS DWORD
    MACRO SetupDiCreateDevRegKey(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, InfHandle, InfSectionName) = SetupDiCreateDevRegKeyA(DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, InfHandle, InfSectionName)
    
    DECLARE FUNCTION SetupDiGetHwProfileListExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileListExA" (BYREF HwProfileList AS DWORD, _
                                                                                                       BYVAL HwProfileListSize AS DWORD, _
                                                                                                       BYREF RequiredSize AS DWORD, _
                                                                                                       BYREF CurrentlyActiveIndex AS DWORD, _
                                                                                                       BYREF MachineName AS ASCIIZ, _
                                                                                                       BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetHwProfileListEx(HwProfileList, HwProfileListSize, RequiredSize, CurrentlyActiveIndex, MachineName, Reserved) = SetupDiGetHwProfileListExA(HwProfileList, HwProfileListSize, RequiredSize, CurrentlyActiveIndex, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceRegistryPropertyA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceRegistryPropertyA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                     BYVAL Property AS DWORD, _
                                                                                                                     BYREF PropertyRegDataType AS DWORD, _
                                                                                                                     BYREF PropertyBuffer AS ANY, _
                                                                                                                     BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetDeviceRegistryProperty(DeviceInfoSet, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize) = _
    SetupDiGetDeviceRegistryPropertyA(DeviceInfoSet, DeviceInfoData, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetClassRegistryPropertyA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassRegistryPropertyA" (BYREF ClassGuid AS GUID, _
                                                                                                                   BYVAL Property AS DWORD, _
                                                                                                                   BYREF PropertyRegDataType AS DWORD, _
                                                                                                                   BYREF PropertyBuffer AS ANY, _
                                                                                                                   BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD, _
                                                                                                                   BYREF MachineName AS ASCIIZ, _
                                                                                                                   BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassRegistryProperty(ClassGuid, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize, MachineName, Reserved) = _
    SetupDiGetClassRegistryPropertyA(ClassGuid, Property, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiSetDeviceRegistryPropertyA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDeviceRegistryPropertyA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS ANY, _
                                                                                                                     BYVAL Property AS DWORD, _
                                                                                                                     BYREF PropertyBuffer AS BYTE, _
                                                                                                                     BYVAL PropertyBufferSize AS DWORD) AS LONG
    MACRO SetupDiSetDeviceRegistryProperty(DeviceInfoSet, DeviceInfoData, Property, PropertyBuffer, PropertyBufferSize) = SetupDiSetDeviceRegistryPropertyA(DeviceInfoSet, DeviceInfoData, Property, PropertyBuffer, PropertyBufferSize)
    
    DECLARE FUNCTION SetupDiSetClassRegistryPropertyA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetClassRegistryPropertyA" (BYREF ClassGuid AS GUID, _
                                                                                                                   BYVAL Property AS DWORD, _
                                                                                                                   BYREF PropertyBuffer AS BYTE, _
                                                                                                                   BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                   BYREF MachineName AS ASCIIZ, _
                                                                                                                   BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiSetClassRegistryProperty(ClassGuid, Property, PropertyBuffer, PropertyBufferSize, MachineName, Reserved) = SetupDiSetClassRegistryPropertyA(ClassGuid, Property, PropertyBuffer, PropertyBufferSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetDeviceInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DeviceInstallParams AS SP_DEVINSTALL_PARAMS_A) AS LONG
    MACRO SetupDiGetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, DeviceInstallParams) = SetupDiGetDeviceInstallParamsA(DeviceInfoSet, DeviceInfoData, DeviceInstallParams)
    
    DECLARE FUNCTION SetupDiGetClassInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF ClassInstallParams AS SP_CLASSINSTALL_HEADER, _
                                                                                                             BYVAL ClassInstallParamsSize AS DWORD, _
                                                                                                             BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetClassInstallParams(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize, RequiredSize) = SetupDiGetClassInstallParamsA(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiSetDeviceInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDeviceInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DeviceInstallParams AS SP_DEVINSTALL_PARAMS_A) AS LONG
    MACRO SetupDiSetDeviceInstallParams(DeviceInfoSet, DeviceInfoData, DeviceInstallParams) = SetupDiSetDeviceInstallParamsA(DeviceInfoSet, DeviceInfoData, DeviceInstallParams)
    
    DECLARE FUNCTION SetupDiSetClassInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetClassInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                             BYREF ClassInstallParams AS SP_CLASSINSTALL_HEADER, _
                                                                                                             BYVAL ClassInstallParamsSize AS DWORD) AS LONG
    MACRO SetupDiSetClassInstallParams(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize) = SetupDiSetClassInstallParamsA(DeviceInfoSet, DeviceInfoData, ClassInstallParams, ClassInstallParamsSize)
    
    DECLARE FUNCTION SetupDiGetDriverInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDriverInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_A, _
                                                                                                               BYREF DriverInstallParams AS SP_DRVINSTALL_PARAMS) AS LONG
    MACRO SetupDiGetDriverInstallParams(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams) = SetupDiGetDriverInstallParamsA(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams)
    
    DECLARE FUNCTION SetupDiSetDriverInstallParamsA LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDriverInstallParamsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                               BYREF DriverInfoData AS SP_DRVINFO_DATA_A, _
                                                                                                               BYREF DriverInstallParams AS SP_DRVINSTALL_PARAMS) AS LONG
    MACRO SetupDiSetDriverInstallParams(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams) = SetupDiSetDriverInstallParamsA(DeviceInfoSet, DeviceInfoData, DriverInfoData, DriverInstallParams)
    
    DECLARE FUNCTION SetupDiGetClassImageListExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassImageListExA" (BYREF ClassImageListData AS SP_CLASSIMAGELIST_DATA, _
                                                                                                         BYREF MachineName AS ASCIIZ, _
                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetClassImageListEx(ClassImageListData, MachineName, Reserved) = SetupDiGetClassImageListExA(ClassImageListData, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetClassDevPropertySheetsA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassDevPropertySheetsA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                     BYVAL PropertySheetHeader AS DWORD, _
                                                                                                                     BYVAL PropertySheetHeaderPageListSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD, _
                                                                                                                     BYVAL PropertySheetType AS DWORD) AS LONG
    MACRO SetupDiGetClassDevPropertySheets(DeviceInfoSet, DeviceInfoData, PropertySheetHeader, PropertySheetHeaderPageListSize, RequiredSize, PropertySheetType) = _
    SetupDiGetClassDevPropertySheetsA(DeviceInfoSet, DeviceInfoData, PropertySheetHeader, PropertySheetHeaderPageListSize, RequiredSize, PropertySheetType)
    
    DECLARE FUNCTION SetupDiClassNameFromGuidA LIB "SETUPAPI.DLL" ALIAS "SetupDiClassNameFromGuidA" (BYREF ClassGuid AS GUID, _
                                                                                                     BYREF ClassName AS ASCIIZ, _
                                                                                                     BYVAL ClassNameSize AS DWORD, _
                                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiClassNameFromGuid(ClassGuid, ClassName, ClassNameSize, RequiredSize) = SetupDiClassNameFromGuidA(ClassGuid, ClassName, ClassNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiClassNameFromGuidExA LIB "SETUPAPI.DLL" ALIAS "SetupDiClassNameFromGuidExA" (BYREF ClassGuid AS GUID, _
                                                                                                         BYREF ClassName AS ASCIIZ, _
                                                                                                         BYVAL ClassNameSize AS DWORD, _
                                                                                                         BYREF RequiredSize AS DWORD, _
                                                                                                         BYREF MachineName AS ASCIIZ, _
                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiClassNameFromGuidEx(ClassGuid, ClassName, ClassNameSize, RequiredSize, MachineName, Reserved) = SetupDiClassNameFromGuidExA(ClassGuid, ClassName, ClassNameSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiClassGuidsFromNameA LIB "SETUPAPI.DLL" ALIAS "SetupDiClassGuidsFromNameA" (BYREF ClassName AS ASCIIZ, _
                                                                                                       BYREF ClassGuidList AS GUID, _
                                                                                                       BYVAL ClassGuidListSize AS DWORD, _
                                                                                                       BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiClassGuidsFromName(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize) = SetupDiClassGuidsFromNameA(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiClassGuidsFromNameExA LIB "SETUPAPI.DLL" ALIAS "SetupDiClassGuidsFromNameExA" (BYREF ClassName AS ASCIIZ, _
                                                                                                           BYREF ClassGuidList AS GUID, _
                                                                                                           BYVAL ClassGuidListSize AS DWORD, _
                                                                                                           BYREF RequiredSize AS DWORD, _
                                                                                                           BYREF MachineName AS ASCIIZ, _
                                                                                                           BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiClassGuidsFromNameEx(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved) = SetupDiClassGuidsFromNameExA(ClassName, ClassGuidList, ClassGuidListSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetHwProfileFriendlyNameA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileFriendlyNameA" (BYVAL HwProfile AS DWORD, _
                                                                                                                   BYREF FriendlyName AS ASCIIZ, _
                                                                                                                   BYVAL FriendlyNameSize AS DWORD, _
                                                                                                                   BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetHwProfileFriendlyName(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize) = SetupDiGetHwProfileFriendlyNameA(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize)
    
    DECLARE FUNCTION SetupDiGetHwProfileFriendlyNameExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileFriendlyNameExA" (BYVAL HwProfile AS DWORD, _
                                                                                                                       BYREF FriendlyName AS ASCIIZ, _
                                                                                                                       BYVAL FriendlyNameSize AS DWORD, _
                                                                                                                       BYREF RequiredSize AS DWORD, _
                                                                                                                       BYREF MachineName AS ASCIIZ, _
                                                                                                                       BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetHwProfileFriendlyNameEx(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize, MachineName, Reserved) = SetupDiGetHwProfileFriendlyNameExA(HwProfile, FriendlyName, FriendlyNameSize, RequiredSize, MachineName, Reserved)
    
    DECLARE FUNCTION SetupDiGetActualSectionToInstallA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetActualSectionToInstallA" (BYVAL InfHandle AS HINF, _
                                                                                                                     BYREF InfSectionName AS ASCIIZ, _
                                                                                                                     BYREF InfSectionWithExt AS ASCIIZ, _
                                                                                                                     BYVAL InfSectionWithExtSize AS DWORD, _
                                                                                                                     BYREF RequiredSize AS DWORD, _
                                                                                                                     BYREF Extension AS ASCIIZ) AS LONG
    MACRO SetupDiGetActualSectionToInstall(InfHandle, InfSectionName, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension) = _
    SetupDiGetActualSectionToInstallA(InfHandle, InfSectionName, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension)
    
    DECLARE FUNCTION SetupDiGetActualSectionToInstallExA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetActualSectionToInstallExA" (BYVAL InfHandle AS HINF, _
                                                                                                                         BYREF InfSectionName AS ASCIIZ, _
                                                                                                                         BYREF AlternatePlatformInfo AS SP_ALTPLATFORM_INFO, _
                                                                                                                         BYREF InfSectionWithExt AS ASCIIZ, _
                                                                                                                         BYVAL InfSectionWithExtSize AS DWORD, _
                                                                                                                         BYREF RequiredSize AS DWORD, _
                                                                                                                         BYREF Extension AS ASCIIZ, _
                                                                                                                         BYREF Reserved AS ANY) AS LONG
    MACRO SetupDiGetActualSectionToInstallEx(InfHandle, InfSectionName, AlternatePlatformInfo, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension, Reserved) = _
    SetupDiGetActualSectionToInstallExA(InfHandle, InfSectionName, AlternatePlatformInfo, InfSectionWithExt, InfSectionWithExtSize, RequiredSize, Extension, Reserved)
    
    DECLARE FUNCTION SetupEnumInfSectionsA LIB "SETUPAPI.DLL" ALIAS "SetupEnumInfSectionsA" (BYVAL InfHandle AS HINF, _
                                                                                             BYVAL Index AS DWORD, _
                                                                                             BYREF Buffer AS ASCIIZ, _
                                                                                             BYVAL SIZE AS DWORD, _
                                                                                             BYREF SizeNeeded AS DWORD) AS LONG
    MACRO SetupEnumInfSections(InfHandle, Index, Buffer, SIZE, SizeNeeded) = SetupEnumInfSectionsA(InfHandle, Index, Buffer, SIZE, SizeNeeded)
    
    DECLARE FUNCTION SetupDiGetCustomDevicePropertyA LIB "SETUPAPI.DLL" ALIAS "SetupDiGetCustomDevicePropertyA" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                 BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                                 BYREF CustomPropertyName AS ASCIIZ, _
                                                                                                                 BYVAL Flags AS DWORD, _
                                                                                                                 BYREF PropertyRegDataType AS DWORD, _
                                                                                                                 BYREF PropertyBuffer AS ANY, _
                                                                                                                 BYVAL PropertyBufferSize AS DWORD, _
                                                                                                                 BYREF RequiredSize AS DWORD) AS LONG
    MACRO SetupDiGetCustomDeviceProperty(DeviceInfoSet, DeviceInfoData, CustomPropertyName, Flags, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize) = _
    SetupDiGetCustomDevicePropertyA(DeviceInfoSet, DeviceInfoData, CustomPropertyName, Flags, PropertyRegDataType, PropertyBuffer, PropertyBufferSize, RequiredSize)
    
    DECLARE FUNCTION SetupConfigureWmiFromInfSectionA LIB "SETUPAPI.DLL" ALIAS "SetupConfigureWmiFromInfSectionA" (BYVAL InfHandle AS HINF, _
                                                                                                                   BYREF SectionName AS ASCIIZ, _
                                                                                                                   BYVAL Flags AS DWORD) AS LONG
    MACRO SetupConfigureWmiFromInfSection(InfHandle, SectionName, Flags) = SetupConfigureWmiFromInfSectionA(InfHandle, SectionName, Flags)
    
    
    #ENDIF ' UNICODE or ANSI declares.
    
    
    DECLARE FUNCTION SetupOpenMasterInf LIB "SETUPAPI.DLL" ALIAS "SetupOpenMasterInf" () AS HINF
    DECLARE SUB SetupCloseInfFile LIB "SETUPAPI.DLL" ALIAS "SetupCloseInfFile" (BYVAL InfHandle AS HINF)
    DECLARE FUNCTION SetupFindNextLine LIB "SETUPAPI.DLL" ALIAS "SetupFindNextLine" (BYREF ContextIn AS INFCONTEXT, _
                                                                                     BYREF ContextOut AS INFCONTEXT) AS LONG
    DECLARE FUNCTION SetupGetFieldCount LIB "SETUPAPI.DLL" ALIAS "SetupGetFieldCount" (BYREF inContext AS INFCONTEXT) AS DWORD
    DECLARE FUNCTION SetupGetIntField LIB "SETUPAPI.DLL" ALIAS "SetupGetIntField" (BYREF inContext AS INFCONTEXT, _
                                                                                   BYVAL FieldIndex AS DWORD, _
                                                                                   BYREF IntegerValue AS LONG) AS LONG
    DECLARE FUNCTION SetupGetBinaryField LIB "SETUPAPI.DLL" ALIAS "SetupGetBinaryField" (BYREF inContext AS INFCONTEXT, _
                                                                                         BYVAL FieldIndex AS DWORD, _
                                                                                         BYREF ReturnBuffer AS ANY, _
                                                                                         BYVAL ReturnBufferSize AS DWORD, _
                                                                                         BYREF RequiredSize AS DWORD) AS LONG
    DECLARE FUNCTION SetupCancelTemporarySourceList LIB "SETUPAPI.DLL" ALIAS "SetupCancelTemporarySourceList" () AS LONG
    DECLARE FUNCTION SetupOpenFileQueue LIB "SETUPAPI.DLL" ALIAS "SetupOpenFileQueue" () AS HSPFILEQ
    DECLARE FUNCTION SetupCloseFileQueue LIB "SETUPAPI.DLL" ALIAS "SetupCloseFileQueue" (BYVAL QueueHandle AS HSPFILEQ) AS LONG
    DECLARE FUNCTION SetupGetFileQueueCount LIB "SETUPAPI.DLL" ALIAS "SetupGetFileQueueCount" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                               BYVAL SubQueueFileOp AS DWORD, _
                                                                                               BYREF NumOperations AS DWORD) AS LONG
    DECLARE FUNCTION SetupGetFileQueueFlags LIB "SETUPAPI.DLL" ALIAS "SetupGetFileQueueFlags" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                               BYREF Flags AS DWORD) AS LONG
    DECLARE FUNCTION SetupSetFileQueueFlags LIB "SETUPAPI.DLL" ALIAS "SetupSetFileQueueFlags" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                               BYVAL FlagMask AS DWORD, _
                                                                                               BYVAL Flags AS DWORD) AS LONG
    DECLARE FUNCTION SetupUninstallNewlyCopiedInfs LIB "SETUPAPI.DLL" ALIAS "SetupUninstallNewlyCopiedInfs" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                                             BYVAL Flags AS DWORD, _
                                                                                                             BYREF Reserved AS ANY) AS LONG
    DECLARE FUNCTION SetupDestroyDiskSpaceList LIB "SETUPAPI.DLL" ALIAS "SetupDestroyDiskSpaceList" (BYREF DiskSpace AS ANY) AS LONG
    DECLARE FUNCTION SetupPromptReboot LIB "SETUPAPI.DLL" ALIAS "SetupPromptReboot" (BYVAL FileQueue AS HSPFILEQ, _
                                                                                     BYVAL Owner AS DWORD, _
                                                                                     BYVAL ScanOnly AS LONG) AS LONG
    DECLARE FUNCTION SetupInitDefaultQueueCallback LIB "SETUPAPI.DLL" ALIAS "SetupInitDefaultQueueCallback" (BYVAL OwnerWindow AS DWORD) AS DWORD
    DECLARE FUNCTION SetupInitDefaultQueueCallbackEx LIB "SETUPAPI.DLL" ALIAS "SetupInitDefaultQueueCallbackEx" (BYVAL OwnerWindow AS DWORD, _
                                                                                                                 BYVAL AlternateProgressWindow AS DWORD, _
                                                                                                                 BYVAL ProgressMessage AS DWORD, _
                                                                                                                 BYVAL Reserved1 AS DWORD, _
                                                                                                                 BYREF Reserved2 AS ANY) AS DWORD
    DECLARE SUB SetupTermDefaultQueueCallback LIB "SETUPAPI.DLL" ALIAS "SetupTermDefaultQueueCallback" (BYREF inContext AS ANY)
    DECLARE FUNCTION SetupTerminateFileLog LIB "SETUPAPI.DLL" ALIAS "SetupTerminateFileLog" (BYVAL FileLogHandle AS HSPFILELOG) AS LONG
    DECLARE FUNCTION SetupOpenLog LIB "SETUPAPI.DLL" ALIAS "SetupOpenLog" (BYVAL bErase AS LONG) AS LONG
    DECLARE SUB SetupCloseLog LIB "SETUPAPI.DLL" ALIAS "SetupCloseLog"
    DECLARE FUNCTION SetupSetNonInteractiveMode LIB "SETUPAPI.DLL" ALIAS "SetupSetNonInteractiveMode" (BYVAL NonInteractiveFlag AS LONG) AS LONG
    DECLARE FUNCTION SetupGetNonInteractiveMode LIB "SETUPAPI.DLL" ALIAS "SetupGetNonInteractiveMode" () AS LONG
    DECLARE FUNCTION SetupDiCreateDeviceInfoList LIB "SETUPAPI.DLL" ALIAS "SetupDiCreateDeviceInfoList" (BYREF ClassGuid AS GUID, _
                                                                                                         BYVAL hwndParent AS DWORD) AS DWORD
    DECLARE FUNCTION SetupDiGetDeviceInfoListClass LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInfoListClass" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                             BYREF ClassGuid AS GUID) AS LONG
    DECLARE FUNCTION SetupDiDeleteDeviceInfo LIB "SETUPAPI.DLL" ALIAS "SetupDiDeleteDeviceInfo" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                 BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiEnumDeviceInfo LIB "SETUPAPI.DLL" ALIAS "SetupDiEnumDeviceInfo" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                             BYVAL MemberIndex AS DWORD, _
                                                                                             BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiDestroyDeviceInfoList LIB "SETUPAPI.DLL" ALIAS "SetupDiDestroyDeviceInfoList" (BYVAL DeviceInfoSet AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiEnumDeviceInterfaces LIB "SETUPAPI.DLL" ALIAS "SetupDiEnumDeviceInterfaces" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                         BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                         BYREF InterfaceClassGuid AS GUID, _
                                                                                                         BYVAL MemberIndex AS DWORD, _
                                                                                                         BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    DECLARE FUNCTION SetupDiGetDeviceInterfaceAlias LIB "SETUPAPI.DLL" ALIAS "SetupDiGetDeviceInterfaceAlias" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                               BYREF AliasInterfaceClassGuid AS GUID, _
                                                                                                               BYREF AliasDeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    DECLARE FUNCTION SetupDiDeleteDeviceInterfaceData LIB "SETUPAPI.DLL" ALIAS "SetupDiDeleteDeviceInterfaceData" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                   BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA) AS LONG
    DECLARE FUNCTION SetupDiRemoveDeviceInterface LIB "SETUPAPI.DLL" ALIAS "SetupDiRemoveDeviceInterface" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                           BYREF DeviceInterfaceData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiInstallDeviceInterfaces LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallDeviceInterfaces" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiSetDeviceInterfaceDefault LIB "SETUPAPI.DLL" ALIAS "SetupDiSetDeviceInterfaceDefault" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                   BYREF DeviceInterfaceData AS ANY, _
                                                                                                                   BYVAL Flags AS DWORD, _
                                                                                                                   BYREF Reserved AS ANY) AS LONG
    DECLARE FUNCTION SetupDiRegisterDeviceInfo LIB "SETUPAPI.DLL" ALIAS "SetupDiRegisterDeviceInfo" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS ANY, _
                                                                                                     BYVAL Flags AS DWORD, _
                                                                                                     BYVAL CompareProc AS DWORD, _
                                                                                                     BYREF CompareContext AS ANY, _
                                                                                                     BYREF DupDeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiBuildDriverInfoList LIB "SETUPAPI.DLL" ALIAS "SetupDiBuildDriverInfoList" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                       BYREF DeviceInfoData AS ANY, _
                                                                                                       BYVAL DriverType AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiCancelDriverInfoSearch LIB "SETUPAPI.DLL" ALIAS "SetupDiCancelDriverInfoSearch" (BYVAL DeviceInfoSet AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiDestroyDriverInfoList LIB "SETUPAPI.DLL" ALIAS "SetupDiDestroyDriverInfoList" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                           BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                                           BYVAL DriverType AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiBuildClassInfoList LIB "SETUPAPI.DLL" ALIAS "SetupDiBuildClassInfoList" (BYVAL Flags AS DWORD, _
                                                                                                     BYREF ClassGuidList AS GUID, _
                                                                                                     BYVAL ClassGuidListSize AS DWORD, _
                                                                                                     BYREF RequiredSize AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiCallClassInstaller LIB "SETUPAPI.DLL" ALIAS "SetupDiCallClassInstaller" (BYVAL InstallFunction AS DI_FUNCTION, _
                                                                                                     BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiSelectDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiSelectDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                         BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiSelectBestCompatDrv LIB "SETUPAPI.DLL" ALIAS "SetupDiSelectBestCompatDrv" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                       BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiInstallDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                           BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiInstallDriverFiles LIB "SETUPAPI.DLL" ALIAS "SetupDiInstallDriverFiles" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiRegisterCoDeviceInstallers LIB "SETUPAPI.DLL" ALIAS "SetupDiRegisterCoDeviceInstallers" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                     BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiRemoveDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiRemoveDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                         BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiUnremoveDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiUnremoveDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                             BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiChangeState LIB "SETUPAPI.DLL" ALIAS "SetupDiChangeState" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                       BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiOpenClassRegKey LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenClassRegKey" (BYREF ClassGuid AS GUID, _
                                                                                               BYVAL samDesired AS DWORD) AS DWORD
    DECLARE FUNCTION SetupDiOpenDeviceInterfaceRegKey LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDeviceInterfaceRegKey" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                   BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                   BYVAL Reserved AS DWORD, _
                                                                                                                   BYVAL samDesired AS DWORD) AS DWORD
    DECLARE FUNCTION SetupDiDeleteDeviceInterfaceRegKey LIB "SETUPAPI.DLL" ALIAS "SetupDiDeleteDeviceInterfaceRegKey" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                                       BYREF DeviceInterfaceData AS SP_DEVICE_INTERFACE_DATA, _
                                                                                                                       BYVAL Reserved AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiOpenDevRegKey LIB "SETUPAPI.DLL" ALIAS "SetupDiOpenDevRegKey" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                           BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                           BYVAL Scope AS DWORD, _
                                                                                           BYVAL HwProfile AS DWORD, _
                                                                                           BYVAL KeyType AS DWORD, _
                                                                                           BYVAL samDesired AS DWORD) AS DWORD
    DECLARE FUNCTION SetupDiDeleteDevRegKey LIB "SETUPAPI.DLL" ALIAS "SetupDiDeleteDevRegKey" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                               BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                               BYVAL Scope AS DWORD, _
                                                                                               BYVAL HwProfile AS DWORD, _
                                                                                               BYVAL KeyType AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiGetHwProfileList LIB "SETUPAPI.DLL" ALIAS "SetupDiGetHwProfileList" (BYREF HwProfileList AS DWORD, _
                                                                                                 BYVAL HwProfileListSize AS DWORD, _
                                                                                                 BYREF RequiredSize AS DWORD, _
                                                                                                 BYREF CurrentlyActiveIndex AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiLoadClassIcon LIB "SETUPAPI.DLL" ALIAS "SetupDiLoadClassIcon" (BYREF ClassGuid AS GUID, _
                                                                                           BYREF LargeIcon AS DWORD, _
                                                                                           BYREF MiniIconIndex AS LONG) AS LONG
    DECLARE FUNCTION SetupDiDrawMiniIcon LIB "SETUPAPI.DLL" ALIAS "SetupDiDrawMiniIcon" (BYVAL hdc AS DWORD, _
                                                                                         BYVAL rc AS RECT, _
                                                                                         BYVAL MiniIconIndex AS LONG, _
                                                                                         BYVAL Flags AS DWORD) AS LONG
    DECLARE FUNCTION SetupDiGetClassBitmapIndex LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassBitmapIndex" (BYREF ClassGuid AS GUID, _
                                                                                                       BYREF MiniIconIndex AS LONG) AS LONG
    DECLARE FUNCTION SetupDiGetClassImageList LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassImageList" (BYREF ClassImageListData AS SP_CLASSIMAGELIST_DATA) AS LONG
    DECLARE FUNCTION SetupDiGetClassImageIndex LIB "SETUPAPI.DLL" ALIAS "SetupDiGetClassImageIndex" (BYREF ClassImageListData AS SP_CLASSIMAGELIST_DATA, _
                                                                                                     BYREF ClassGuid AS GUID, _
                                                                                                     BYREF ImageIndex AS LONG) AS LONG
    DECLARE FUNCTION SetupDiDestroyClassImageList LIB "SETUPAPI.DLL" ALIAS "SetupDiDestroyClassImageList" (BYREF ClassImageListData AS SP_CLASSIMAGELIST_DATA) AS LONG
    DECLARE FUNCTION SetupDiAskForOEMDisk LIB "SETUPAPI.DLL" ALIAS "SetupDiAskForOEMDisk" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                           BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiSelectOEMDrv LIB "SETUPAPI.DLL" ALIAS "SetupDiSelectOEMDrv" (BYVAL hwndParent AS DWORD, _
                                                                                         BYVAL DeviceInfoSet AS DWORD, _
                                                                                         BYREF DeviceInfoData AS ANY) AS LONG
    DECLARE FUNCTION SetupDiGetWizardPage LIB "SETUPAPI.DLL" ALIAS "SetupDiGetWizardPage" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                           BYREF DeviceInfoData AS SP_DEVINFO_DATA, _
                                                                                           BYREF InstallWizardData AS SP_INSTALLWIZARD_DATA, _
                                                                                           BYVAL PageType AS DWORD, _
                                                                                           BYVAL Flags AS DWORD) AS DWORD
    DECLARE FUNCTION SetupDiGetSelectedDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiGetSelectedDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    DECLARE FUNCTION SetupDiSetSelectedDevice LIB "SETUPAPI.DLL" ALIAS "SetupDiSetSelectedDevice" (BYVAL DeviceInfoSet AS DWORD, _
                                                                                                   BYREF DeviceInfoData AS SP_DEVINFO_DATA) AS LONG
    
    
    #ENDIF '  %SETUPAPI
    and my test program to list the info
    Code:
    '**************************************************************************************************
    '*** Programmer: Cliff Nichols
    '*** Concept: Example to get VID and PID info from USB driver
    '*** Date: 12-14-07
    '*** Last Update: 12-15-07
    '*** Special Thanks:
    '***      Kev Peel for SetupApi.INC
    '***      Walt Decker, José Roca, Knuth Konrad and others for their reminders of concepts that
    '***            are often overlooked (see "Parameter as Reply" discussion for more)
    '**************************************************************************************************
    #COMPILE EXE
    #DIM ALL
    '------------------------------------- INCLUDES ---------------------------------------------------
    #INCLUDE "WIN32API.INC"            'Define Windows OS variables and functions
    #INCLUDE "SetupApi.INC"            'Windows Setup Api                                                                        '<--- Many thanx to Kev Peel for this
    #INCLUDE "SetupApiClassInfo.INC"   'Wrapper for SetupApi                                                                     '<--- Cliff Nichols Wrapper to SetupApi
    '--------------------------------------------------------------------------------------------------
    
    '------------------------------------- DECLARES ---------------------------------------------------
    DECLARE FUNCTION WINMAIN ( _
                                  BYVAL hInstance     AS LONG, _                                                                 ' handle of current instance
                                  BYVAL hPrevInstance AS LONG, _                                                                 ' handle of previous instance(not used in Win32)
                                  BYVAL pszCmdLine    AS ASCIIZ PTR, _                                                           ' address of command line
                                  BYVAL nCmdShow      AS LONG _                                                                  ' show state of window
                             ) AS LONG
    DECLARE CALLBACK FUNCTION ShowDIALOG1Proc()
    DECLARE FUNCTION SetGetDlgListUsbDevice(BYREF SetHwndDlg AS DWORD, BYREF GetHwndDlg AS DWORD)AS DWORD
    '--------------------------------------------------------------------------------------------------
    
    '-------------------------------------- GLOBALS ---------------------------------------------------
    '***
    '*** Look Ma.....No Globals!!!!!!!!! :-)
    '***
    '--------------------------------------------------------------------------------------------------
    
    '------------------------------------- EQUATES ----------------------------------------------------
    %IDD_DIALOG1  =  101
    %IDC_TEXTBOX1 = 1001
    '--------------------------------------------------------------------------------------------------
    CALLBACK FUNCTION ShowDIALOG1Proc()
         LOCAL i AS LONG                                                                                                                         'Counter for array of Driver info
         LOCAL Success AS DWORD                                                                                                  'If want to test if function passed of failed
         LOCAL PortInfo AS STRING                                                                                                'String for accumulated results
         LOCAL InfoUsbDriver() AS DeviceDriver                                                                                   'Set array for UDT
         LOCAL UsbDeviceType AS STRING                                                                                           'Variable for UDT element
         LOCAL UsbVid AS STRING                                                                                                  'Variable for UDT element
         LOCAL UsbPid AS STRING                                                                                                  'Variable for UDT element
         LOCAL UsbSubSys AS STRING                                                                                               'Variable for UDT element
         LOCAL UsbRev AS STRING                                                                                                  'Variable for UDT element
    
         LOCAL hDlg AS DWORD
         LOCAL TempSetDlg AS DWORD
         LOCAL FuncErr AS DWORD
         
         SELECT CASE AS LONG CBMSG
              CASE %WM_INITDIALOG
                   PortInfo = ""                                               'Clear Variable                                                                                                 'Just to ensure PortInfo has nothing in it
                   Success = ListUsbDrivers(InfoUsbDriver())                   'Get USB Driver Info                                                  'Enumerate drivers, depending on what info you want
                   REDIM PRESERVE InfoUsbDriver(UBOUND(InfoUsbDriver))         'Redim Preserve the info to work correctly                                                  'Redim local array to equal "Parameter as Reply" array
    
                   FOR i = LBOUND(InfoUsbDriver) TO UBOUND(InfoUsbDriver)      'Format information into readable format                                                  'Get the status of each port
                        PortInfo = PortInfo + "HardWare Id = " + InfoUsbDriver(i).HardwareId + $CRLF  + $CRLF                    'HardwareId holds VID, PID, SubSystem, and Revision peices in one reply
                        Success = GetUsbDeviceType(InfoUsbDriver(i), UsbDeviceType)                                              'Get Info
                        IF UsbDeviceType <> "" THEN PortInfo = PortInfo + $TAB + "Device Type = " + UsbDeviceType + $CRLF        'Show Info
                        Success = GetUsbVid(InfoUsbDriver(i), UsbVid)                                                            'Get Info
                        IF UsbVid <> "" THEN PortInfo = PortInfo + $TAB + "Vendor Id = " + UsbVid + $CRLF                        'Show Info
                        Success = GetUsbPid(InfoUsbDriver(i), UsbPid)                                                            'Get Info
                        IF UsbPid <> "" THEN PortInfo = PortInfo + $TAB + "Product Id = " + UsbPid + $CRLF                       'Show Info
                        Success = GetUsbSubSys(InfoUsbDriver(i), UsbSubSys)                                                      'Get Info
                        IF UsbSubSys <> "" THEN PortInfo = PortInfo + $TAB + "SubSystem = " + UsbSubSys + $CRLF                  'Show Info
                        Success = GetUsbRev(InfoUsbDriver(i), UsbRev)                                                            'Get Info
                        IF UsbRev <> "" THEN PortInfo = PortInfo + $TAB + "Revision = " + UsbRev + $CRLF                         'Show Info
                        PortInfo = PortInfo + STRING$(120, "-")                                                                  'Get Info
                        PortInfo = PortInfo + $CRLF + $CRLF + $CRLF                                                              'Show divider line
                   NEXT i                                                                                                        'Add a couple of breaks before the next one shown
    
                   FuncErr = SetGetDlgListUsbDevice(TempSetDlg, hDlg)          'Get the dialog handle
                   CONTROL SET TEXT hDlg, %IDC_TEXTBOX1, PortInfo              'Show the formatted text                                                  'Set the text
              CASE %WM_NCACTIVATE
                   STATIC hWndSaveFocus AS DWORD
                   IF ISFALSE CBWPARAM THEN
                        hWndSaveFocus = GetFocus()                             ' Save control focus
                   ELSEIF hWndSaveFocus THEN
                        SetFocus(hWndSaveFocus)                                'Restore control focus
                        hWndSaveFocus = 0
                   END IF
              CASE %WM_COMMAND
    '*** Process control notifications
                   SELECT CASE AS LONG CBCTL
                        CASE %IDC_TEXTBOX1
                        CASE ELSE
                   END SELECT
              CASE %WM_DESTROY
                   PostQuitMessage 0                                           'Stop the message pump
        END SELECT
    END FUNCTION
    '------------------------------------------------------------------------------
    FUNCTION WINMAIN ( _
                        BYVAL hInstance     AS LONG, _                         ' handle of current instance
                        BYVAL hPrevInstance AS LONG, _                         ' handle of previous instance(not used in Win32)
                        BYVAL pszCmdLine    AS ASCIIZ PTR, _                   ' address of command line
                        BYVAL nCmdShow      AS LONG _                          ' show state of window
                     ) AS LONG
         LOCAL hDlg  AS DWORD                                                  'Variable for Dlg Handle
         LOCAL TemphDlg AS DWORD                                               'Variable for Temp Handle
         LOCAL FuncErr AS DWORD                                                'Variable for if Function passes or fails
         
         LOCAL tmsg AS TagMsg                                                  'Variable for Windows Messages
         DIALOG NEW %HWND_DESKTOP, "Dialog1", 70, 70, 201, 121, _              'Create new dialog
                        %WS_POPUP OR %WS_BORDER OR %WS_DLGFRAME _
                        OR %WS_CAPTION OR %WS_SYSMENU _
                        OR %WS_CLIPSIBLINGS OR %WS_VISIBLE _
                        OR %DS_MODALFRAME OR %DS_3DLOOK _
                        OR %DS_NOFAILCREATE OR %DS_SETFONT, _
                        %WS_EX_CONTROLPARENT OR %WS_EX_LEFT _
                        OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR, TO hDlg
    
         FuncErr = SetGetDlgListUsbDevice(hDlg, TemphDlg)                      'Pass Windows Handle so it can be used in other functions
    
         CONTROL ADD TEXTBOX, hDlg, %IDC_TEXTBOX1, "TextBox1", 0, 0, 200, 120, _ 'Create Textbox
              %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_HSCROLL OR _
              %WS_VSCROLL OR %ES_LEFT OR %ES_MULTILINE OR %ES_AUTOHSCROLL OR _
              %ES_AUTOVSCROLL, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR _
              %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR
    
         DIALOG SHOW MODELESS hDlg, CALL ShowDIALOG1Proc                       'Show dialog Modeless
    '*** Acquire and dispatch messages until a WM_QUIT message is received.
         WHILE ISTRUE GetMessage(tmsg, BYVAL %NULL, 0, 0)
              TranslateMessage tmsg
              DispatchMessage tmsg
         WEND
    END FUNCTION
    
    FUNCTION SetGetDlgListUsbDevice(BYREF SetHwndDlg AS DWORD, BYREF GetHwndDlg AS DWORD)AS DWORD
         ON ERROR GOTO ErrHandler                                              'If error then goto error handler
         STATIC TempHwndDlg AS DWORD                                           'Static variable to hold Windows Handle
         IF SetHwndDlg <> 0 THEN                                               'If Setting or Resetting Windows Handle
              GetHwndDlg = SetHwndDlg                                          'Return the new Handle
              TempHwndDlg = SetHwndDlg                                         'Change the value of the static variable for future calls
         ELSE                                                                  'If Asking for current value of Windows Handle
              GetHwndDlg = TempHwndDlg                                         'Return the current Handle
         END IF
         FUNCTION = %False             'Return %False if no errors   '<--- Not really needed but kept for readability
         EXIT FUNCTION                 'Exit function so correct value returned
    ErrHandler:                        'If error then jump to here
         FUNCTION = GetLastError()     'If error then return ErrorNumber
    END FUNCTION
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    Corrected Link back to discussion.

    Comment

    Working...
    X