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.

svn path=/trunk/; revision=15020
This commit is contained in:
Gé van Geldorp 2005-05-05 20:14:39 +00:00
parent 30cd41fa52
commit 6758bb095b
5 changed files with 28 additions and 11 deletions

View file

@ -36,13 +36,16 @@ typedef CHAR *DEVINSTID_A;
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 );

View file

@ -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 @@ BOOL WINAPI SetupDiClassNameFromGuidExA(
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 @@ static HDEVINFO SETUP_CreateSerialDeviceList(void)
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 @@ static HDEVINFO SETUP_CreateSerialDeviceList(void)
{
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",

View file

@ -58,7 +58,7 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT
if (rc == 0)
return NULL;
list = (LPDISKSPACELIST)HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
list->dwDriveCount = 0;

View file

@ -363,9 +363,7 @@ static INT_PTR sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
} 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;
}

View file

@ -99,7 +99,7 @@ BOOL WINAPI SetupCopyOEMInfA(PCSTR sourceinffile, PCSTR sourcemedialoc,
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;
}