mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
[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:
parent
8ffb29a268
commit
00356397b2
3 changed files with 25 additions and 25 deletions
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue