- Fix header mess by using a common header setupapi_private.h
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 6 Nov 2005 23:23:45 +0000 (23:23 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 6 Nov 2005 23:23:45 +0000 (23:23 +0000)
- Move some structure definitions from devinst.c to setupapi_private.h

svn path=/trunk/; revision=19031

15 files changed:
reactos/lib/setupapi/cfgmgr.c
reactos/lib/setupapi/devinst.c
reactos/lib/setupapi/dirid.c
reactos/lib/setupapi/diskspace.c
reactos/lib/setupapi/infparse.c
reactos/lib/setupapi/install.c
reactos/lib/setupapi/misc.c
reactos/lib/setupapi/parser.c
reactos/lib/setupapi/queue.c
reactos/lib/setupapi/rpc.c
reactos/lib/setupapi/setupapi_private.h
reactos/lib/setupapi/setupcab.c
reactos/lib/setupapi/stringtable.c
reactos/lib/setupapi/stubs.c
reactos/lib/setupapi/virtcopy.c

index 4a0cec8..8a7daad 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "winreg.h"
-#include "setupapi.h"
-#include "cfgmgr32.h"
 #include "setupapi_private.h"
 
-#include "rpc.h"
-#include "rpc_private.h"
-
-#include "pnp_c.h"
-
-#include "wine/debug.h"
-
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 /* Registry key and value names */
index 1119d24..39f5951 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
-#include <stdarg.h>
-
-#include <windows.h>
-#include "setupapi.h"
-#include "wine/debug.h"
-#include "wine/unicode.h"
-#include "cfgmgr32.h"
-#include "initguid.h"
-#define NTOS_MODE_USER
-#include <ndk/ntndk.h>
-
+#define INITGUID
 #include "setupapi_private.h"
 
-
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 /* Unicode constants */
@@ -87,8 +73,6 @@ typedef DWORD
     IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
     IN OUT PCOINSTALLER_CONTEXT_DATA Context);
 
-#define SETUP_DEV_INFO_SET_MAGIC 0xd00ff057
-
 struct CoInstallerElement
 {
     LIST_ENTRY ListEntry;
@@ -99,105 +83,6 @@ struct CoInstallerElement
     PVOID PrivateData;
 };
 
-struct DeviceInterface /* Element of DeviceInfoElement.InterfaceListHead */
-{
-    LIST_ENTRY ListEntry;
-
-    struct DeviceInfoElement* DeviceInfo;
-    GUID InterfaceClassGuid;
-
-    
-    /* SPINT_ACTIVE : the interface is active/enabled
-     * SPINT_DEFAULT: the interface is the default interface for the device class FIXME???
-     * SPINT_REMOVED: the interface is removed
-     */
-    DWORD Flags;
-
-    WCHAR SymbolicLink[0]; /* \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
-};
-
-/* We don't want to open the .inf file to read only one information in it, so keep a handle to it once it
- * has been already loaded once. Keep also a reference counter */
-struct InfFileDetails
-{
-    HINF hInf;
-    LONG References;
-};
-
-struct DriverInfoElement /* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
-{
-    LIST_ENTRY ListEntry;
-
-    DWORD DriverRank;
-    SP_DRVINFO_DATA_V2_W Info;
-    SP_DRVINFO_DETAIL_DATA_W Details;
-    GUID ClassGuid;
-    LPWSTR MatchingId;
-    struct InfFileDetails *InfFileDetails;
-};
-
-struct DeviceInfoElement /* Element of DeviceInfoSet.ListHead */
-{
-    LIST_ENTRY ListEntry;
-
-    /* Reserved Field points to a struct DriverInfoElement */
-    SP_DEVINSTALL_PARAMS_W InstallParams;
-
-    /* Information about devnode:
-     * - DeviceName:
-     *       "Root\*PNP0501" for example.
-     *       It doesn't contain the unique ID for the device
-     *       (points into the Data field at the end of the structure)
-     *       WARNING: no NULL char exist between DeviceName and UniqueId
-     *       in Data field!
-     * - UniqueId
-     *       "5&1be2108e&0" or "0000"
-     *       If DICD_GENERATE_ID is specified in creation flags,
-     *       this unique ID is autogenerated using 4 digits, base 10
-     *       (points into the Data field at the end of the structure)
-     * - DeviceDescription
-     *       String which identifies the device. Can be NULL. If not NULL,
-     *       points into the Data field at the end of the structure
-     * - ClassGuid
-     *       Identifies the class of this device. FIXME: can it be GUID_NULL?
-     * - CreationFlags
-     *       Is a combination of:
-     *       - DICD_GENERATE_ID
-     *              the unique ID needs to be generated
-     *       - DICD_INHERIT_CLASSDRVS
-     *              inherit driver of the device info set (== same pointer)
-     */
-    PCWSTR DeviceName;
-    PCWSTR UniqueId;
-    PCWSTR DeviceDescription;
-    GUID ClassGuid;
-    DWORD CreationFlags;
-
-    /* If CreationFlags contains DICD_INHERIT_CLASSDRVS, this list is invalid */
-    /* If the driver is not searched/detected, this list is empty */
-    LIST_ENTRY DriverListHead; /* List of struct DriverInfoElement */
-
-    /* List of interfaces implemented by this device */
-    LIST_ENTRY InterfaceListHead; /* List of struct DeviceInterface */
-
-    WCHAR Data[0];
-};
-
-struct DeviceInfoSet /* HDEVINFO */
-{
-    DWORD magic; /* SETUP_DEV_INFO_SET_MAGIC */
-    GUID ClassGuid; /* If != GUID_NULL, only devices of this class can be in the device info set */
-    HKEY HKLM; /* Local or distant HKEY_LOCAL_MACHINE registry key */
-
-    /* Reserved Field points to a struct DriverInfoElement */
-    SP_DEVINSTALL_PARAMS_W InstallParams;
-
-    /* If the driver is not searched/detected, this list is empty */
-    LIST_ENTRY DriverListHead; /* List of struct DriverInfoElement */
-
-    LIST_ENTRY ListHead; /* List of struct DeviceInfoElement */
-};
-
 /***********************************************************************
  *              SetupDiBuildClassInfoList  (SETUPAPI.@)
  */
@@ -5465,6 +5350,10 @@ SetupDiGetDriverInfoDetailW(
 {
     BOOL ret = FALSE;
 
+    TRACE("%p %p %p %p %lu %p\n", DeviceInfoSet, DeviceInfoData,
+        DriverInfoData, DriverInfoDetailData,
+        DriverInfoDetailDataSize, RequiredSize);
+
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
@@ -5482,7 +5371,7 @@ SetupDiGetDriverInfoDetailW(
     else if (DriverInfoDetailData && DriverInfoDetailData->cbSize != sizeof(SP_DRVINFO_DETAIL_DATA_W))
         SetLastError(ERROR_INVALID_USER_BUFFER);
     else if (DriverInfoDetailData && DriverInfoDetailData->Reserved == 0)
-        SetLastError(ERROR_INVALID_PARAMETER);
+        SetLastError(ERROR_NO_DRIVER_SELECTED);
     else
     {
         struct DriverInfoElement *driverInfoElement;
index 639da02..65bcc55 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "winerror.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "setupapi.h"
-#include "shlobj.h"
-#include "wine/unicode.h"
 #include "setupapi_private.h"
-#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index 6f513b6..832dedd 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "winreg.h"
-#include "setupapi.h"
-#include "wine/debug.h"
+#include "setupapi_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index c508db6..3c7f8d1 100644 (file)
  *   (IpSaveRestorePosition, IpFindNextMatchLine, ...).
  */
 
-#include <stdarg.h>
-#include <string.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "setupapi.h"
-#include "setupx16.h"
 #include "setupapi_private.h"
-#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index 639259d..4326f0b 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "winerror.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "setupapi.h"
 #include "setupapi_private.h"
-#include "wine/unicode.h"
-#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index c8ad60c..ec3b178 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winreg.h"
-#include "setupapi.h"
-
-#include "wine/unicode.h"
-#include "wine/debug.h"
-
 #include "setupapi_private.h"
 
-
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
-
 /**************************************************************************
  * MyFree [SETUPAPI.@]
  *
index b69f125..9a9a9e4 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
-#include <assert.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "winerror.h"
-#include "cfgmgr32.h"
-#include "setupapi.h"
 #include "setupapi_private.h"
 
-#include "wine/unicode.h"
-#include "wine/debug.h"
-
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 /* Unicode constants */
index d7bb0d1..06d3184 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "winerror.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "setupapi.h"
-#include "wine/unicode.h"
 #include "setupapi_private.h"
-#include "winver.h"
-#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index 44f19dd..d0bb283 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <windows.h>
-#include <rpc.h>
-#include <rpcdce.h>
-#include <setupapi.h>
-#include "rpc_private.h"
+#include "setupapi_private.h"
 
+WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 static RPC_BINDING_HANDLE LocalBindingHandle = NULL;
 static HSTRING_TABLE LocalStringTable = NULL;
index 69ac932..8e15423 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2001 Andreas Mohr
+ * Copyright 2005 Hervé Poussineau
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 #ifndef __SETUPAPI_PRIVATE_H
 #define __SETUPAPI_PRIVATE_H
 
+#include <assert.h>
+#include <fcntl.h>
+#include <share.h>
+
+#include <windows.h>
+#include <cfgmgr32.h>
+#include <fdi.h>
+#include <setupapi.h>
+#include <shlobj.h>
+#include <wine/debug.h>
+#include <wine/unicode.h>
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
+
+#include <pnp_c.h>
+#include "rpc_private.h"
+#include "resource.h"
+
+#define SETUP_DEV_INFO_SET_MAGIC 0xd00ff057
+
+struct DeviceInterface /* Element of DeviceInfoElement.InterfaceListHead */
+{
+    LIST_ENTRY ListEntry;
+
+    struct DeviceInfoElement* DeviceInfo;
+    GUID InterfaceClassGuid;
+
+    
+    /* SPINT_ACTIVE : the interface is active/enabled
+     * SPINT_DEFAULT: the interface is the default interface for the device class FIXME???
+     * SPINT_REMOVED: the interface is removed
+     */
+    DWORD Flags;
+
+    WCHAR SymbolicLink[0]; /* \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
+};
+
+/* We don't want to open the .inf file to read only one information in it, so keep a handle to it once it
+ * has been already loaded once. Keep also a reference counter */
+struct InfFileDetails
+{
+    HINF hInf;
+    LONG References;
+};
+
+struct DriverInfoElement /* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
+{
+    LIST_ENTRY ListEntry;
+
+    DWORD DriverRank;
+    SP_DRVINFO_DATA_V2_W Info;
+    SP_DRVINFO_DETAIL_DATA_W Details;
+    GUID ClassGuid;
+    LPWSTR MatchingId;
+    struct InfFileDetails *InfFileDetails;
+};
+
+struct DeviceInfoElement /* Element of DeviceInfoSet.ListHead */
+{
+    LIST_ENTRY ListEntry;
+
+    /* Reserved Field points to a struct DriverInfoElement */
+    SP_DEVINSTALL_PARAMS_W InstallParams;
+
+    /* Information about devnode:
+     * - DeviceName:
+     *       "Root\*PNP0501" for example.
+     *       It doesn't contain the unique ID for the device
+     *       (points into the Data field at the end of the structure)
+     *       WARNING: no NULL char exist between DeviceName and UniqueId
+     *       in Data field!
+     * - UniqueId
+     *       "5&1be2108e&0" or "0000"
+     *       If DICD_GENERATE_ID is specified in creation flags,
+     *       this unique ID is autogenerated using 4 digits, base 10
+     *       (points into the Data field at the end of the structure)
+     * - DeviceDescription
+     *       String which identifies the device. Can be NULL. If not NULL,
+     *       points into the Data field at the end of the structure
+     * - ClassGuid
+     *       Identifies the class of this device. FIXME: can it be GUID_NULL?
+     * - CreationFlags
+     *       Is a combination of:
+     *       - DICD_GENERATE_ID
+     *              the unique ID needs to be generated
+     *       - DICD_INHERIT_CLASSDRVS
+     *              inherit driver of the device info set (== same pointer)
+     */
+    PCWSTR DeviceName;
+    PCWSTR UniqueId;
+    PCWSTR DeviceDescription;
+    GUID ClassGuid;
+    DWORD CreationFlags;
+
+    /* If CreationFlags contains DICD_INHERIT_CLASSDRVS, this list is invalid */
+    /* If the driver is not searched/detected, this list is empty */
+    LIST_ENTRY DriverListHead; /* List of struct DriverInfoElement */
+
+    /* List of interfaces implemented by this device */
+    LIST_ENTRY InterfaceListHead; /* List of struct DeviceInterface */
+
+    WCHAR Data[0];
+};
+
+struct DeviceInfoSet /* HDEVINFO */
+{
+    DWORD magic; /* SETUP_DEV_INFO_SET_MAGIC */
+    GUID ClassGuid; /* If != GUID_NULL, only devices of this class can be in the device info set */
+    HKEY HKLM; /* Local or distant HKEY_LOCAL_MACHINE registry key */
+
+    /* Reserved Field points to a struct DriverInfoElement */
+    SP_DEVINSTALL_PARAMS_W InstallParams;
+
+    /* If the driver is not searched/detected, this list is empty */
+    LIST_ENTRY DriverListHead; /* List of struct DriverInfoElement */
+
+    LIST_ENTRY ListHead; /* List of struct DeviceInfoElement */
+};
+
 #define COPYFILEDLGORD 1000
 #define SOURCESTRORD   500
 #define DESTSTRORD     501
 #define PROGRESSORD    502
 
+extern HINSTANCE hInstance;
+#define RC_STRING_MAX_SIZE 256
 
 #define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles"
 #define REGPART_RENAME "\\Rename"
index db45f77..38267d3 100644 (file)
  *
  */
 
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "wine/debug.h"
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "winreg.h"
-#include "setupapi.h"
 #include "setupapi_private.h"
-#include "fdi.h"
-#include "wine/unicode.h"
-
-#include "fcntl.h"
-#include "share.h"
-
-#include "wine/debug.h"
 
 HINSTANCE hInstance = 0;
 OSVERSIONINFOW OsVersionInfo;
index 52c7978..c56d5b6 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winreg.h"
-#include "setupapi.h"
-
-#include "wine/debug.h"
-
+#include "setupapi_private.h"
 
 #define TABLE_DEFAULT_SIZE 256
 
index 810d71f..14a56f6 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdarg.h>
-
-#include "wine/debug.h"
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "winreg.h"
-#include "setupapi.h"
+#include "setupapi_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
index c506f4a..2c0876e 100644 (file)
  *        This is bad ! We ought to have 16bit resource handling working.
  */
 
-#include <stdarg.h>
-#include <string.h>
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "winreg.h"
-#include "wownt32.h"
-#include "wingdi.h"
-#include "winnls.h"
-#include "setupapi.h"
-#include "setupx16.h"
 #include "setupapi_private.h"
-#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);