Sync to Wine-20050419:
Hans Leidekker <hans@it.vu.nl>
- Stub implementation for SetupCopyOEMInfW.
Peter Berg Larsen <pebl@math.ku.dk>
- Janitorial: Get rid of strncpy/strncpyW.
Jakob Eriksson <jakov@vmlinux.org>
- Get rid of HeapAlloc casts.
Juan Lang <juan_lang@yahoo.com>
- Implement SetupDiClassNameFromGuidExA.
Modified: trunk/reactos/include/wine/cfgmgr32.h
Modified: trunk/reactos/lib/setupapi/devinst.c
Modified: trunk/reactos/lib/setupapi/diskspace.c
Modified: trunk/reactos/lib/setupapi/setupcab.c
Modified: trunk/reactos/lib/setupapi/stubs.c

Modified: trunk/reactos/include/wine/cfgmgr32.h
--- trunk/reactos/include/wine/cfgmgr32.h	2005-05-05 19:36:25 UTC (rev 15019)
+++ trunk/reactos/include/wine/cfgmgr32.h	2005-05-05 20:14:39 UTC (rev 15020)
@@ -36,14 +36,17 @@
 typedef WCHAR *DEVINSTID_W;
 DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID)
 
-
 #define CR_SUCCESS             0x00000000
 #define CR_OUT_OF_MEMORY       0x00000002
 #define CR_INVALID_DATA        0x0000001F
 #define CR_INVALID_MACHINENAME 0x0000002F
 #define CR_ACCESS_DENIED       0x00000033
 
+#define MAX_CLASS_NAME_LEN  32
+#define MAX_GUID_STRING_LEN 39
+#define MAX_PROFILE_LEN     80
 
+
 CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE );
 CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE );
 #define     CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine)
Property changes on: trunk/reactos/include/wine/cfgmgr32.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-05-05 19:36:25 UTC (rev 15019)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-05-05 20:14:39 UTC (rev 15020)
@@ -34,6 +34,7 @@
 #include "setupapi.h"
 #include "wine/debug.h"
 #include "wine/unicode.h"
+#include "cfgmgr32.h"
 #include "initguid.h"
 #include "winioctl.h"
 #include "rpc.h"
@@ -469,8 +470,24 @@
         PCSTR MachineName,
         PVOID Reserved)
 {
-  FIXME("\n");
-  return FALSE;
+    WCHAR ClassNameW[MAX_CLASS_NAME_LEN];
+    LPWSTR MachineNameW = NULL;
+    BOOL ret;
+
+    if (MachineName)
+        MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
+    ret = SetupDiClassNameFromGuidExW(ClassGuid, ClassNameW, MAX_CLASS_NAME_LEN,
+     NULL, MachineNameW, Reserved);
+    if (ret)
+    {
+        int len = WideCharToMultiByte(CP_ACP, 0, ClassNameW, -1, ClassName,
+         ClassNameSize, NULL, NULL);
+
+        if (!ClassNameSize && RequiredSize)
+            *RequiredSize = len;
+    }
+    MyFree(MachineNameW);
+    return ret;
 }
 
 /***********************************************************************
@@ -859,8 +876,7 @@
                 size *= 2;
                 if (devices != buf)
                     HeapFree(GetProcessHeap(), 0, devices);
-                devices = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
-                 size * sizeof(WCHAR));
+                devices = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
                 if (!devices)
                     failed = TRUE;
                 else
@@ -892,7 +908,7 @@
             {
                 if (!strncmpW(comW, ptr, sizeof(comW) / sizeof(comW[0]) - 1))
                 {
-                    strncpyW(list->names[list->numPorts].name, ptr,
+                    lstrcpynW(list->names[list->numPorts].name, ptr,
                      sizeof(list->names[list->numPorts].name) /
                      sizeof(list->names[list->numPorts].name[0]));
                     TRACE("Adding %s to list\n",

Modified: trunk/reactos/lib/setupapi/diskspace.c
--- trunk/reactos/lib/setupapi/diskspace.c	2005-05-05 19:36:25 UTC (rev 15019)
+++ trunk/reactos/lib/setupapi/diskspace.c	2005-05-05 20:14:39 UTC (rev 15020)
@@ -58,7 +58,7 @@
     if (rc == 0)
         return NULL;
 
-    list = (LPDISKSPACELIST)HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
+    list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
 
     list->dwDriveCount = 0;
     

Modified: trunk/reactos/lib/setupapi/setupcab.c
--- trunk/reactos/lib/setupapi/setupcab.c	2005-05-05 19:36:25 UTC (rev 15019)
+++ trunk/reactos/lib/setupapi/setupcab.c	2005-05-05 20:14:39 UTC (rev 15020)
@@ -363,9 +363,7 @@
     } else {
       if (mysterio[0]) {
         /* some easy paranoia.  no such carefulness exists on the wide API IIRC */
-        mysterio[SIZEOF_MYSTERIO - 1] = '\0';
-        strncpy(pfdin->psz3, &(mysterio[0]), 255);
-        mysterio[255] = '\0';
+        lstrcpynA(pfdin->psz3, &(mysterio[0]), SIZEOF_MYSTERIO);
       }
       return 0;
     }

Modified: trunk/reactos/lib/setupapi/stubs.c
--- trunk/reactos/lib/setupapi/stubs.c	2005-05-05 19:36:25 UTC (rev 15019)
+++ trunk/reactos/lib/setupapi/stubs.c	2005-05-05 20:14:39 UTC (rev 15020)
@@ -99,7 +99,7 @@
 			    DWORD destnamesize, PDWORD required,
 			    PSTR *destinfnamecomponent)
 {
-  FIXME("stub: source %s location %sá...\n",sourceinffile, sourcemedialoc);
+  FIXME("stub: source %s location %s ...\n",sourceinffile, sourcemedialoc);
   return FALSE;
 }