[WINESYNC] setupapi: Move strdupW and strdupWtoA to the setupapi_private.h header.

wine commit id 44ab294e0b6f285f1aab5fc8533a36e852be38fa by Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
winesync 2023-09-28 17:44:59 +02:00 committed by Hermès Bélusca-Maïto
parent 8ffb29a268
commit 00356397b2
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 25 additions and 25 deletions

View file

@ -69,29 +69,6 @@ struct file_queue
};
static inline WCHAR *strdupW( const WCHAR *str )
{
WCHAR *ret = NULL;
if (str)
{
int len = (strlenW(str) + 1) * sizeof(WCHAR);
if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) memcpy( ret, str, len );
}
return ret;
}
static inline char *strdupWtoA( const WCHAR *str )
{
char *ret = NULL;
if (str)
{
DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
}
return ret;
}
/* append a file operation to a queue */
static inline void queue_file_op( struct file_op_queue *queue, struct file_op *op )
{

View file

@ -268,7 +268,30 @@ extern DWORD GlobalSetupFlags;
#define REGPART_RENAME "\\Rename"
#define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager"
inline static WCHAR *strdupAtoW( const char *str )
static inline WCHAR *strdupW( const WCHAR *str )
{
WCHAR *ret = NULL;
if (str)
{
int len = (strlenW(str) + 1) * sizeof(WCHAR);
if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) memcpy( ret, str, len );
}
return ret;
}
static inline char *strdupWtoA( const WCHAR *str )
{
char *ret = NULL;
if (str)
{
DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
}
return ret;
}
static inline WCHAR *strdupAtoW( const char *str )
{
WCHAR *ret = NULL;
if (str)

View file

@ -6,4 +6,4 @@ files:
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable.c
include/setupapi.h: sdk/include/psdk/setupapi.h
tags:
wine: wine-0.9.59
wine: 44ab294e0b6f285f1aab5fc8533a36e852be38fa