Module: wine Branch: master Commit: 44ab294e0b6f285f1aab5fc8533a36e852be38fa URL: http://source.winehq.org/git/wine.git/?a=commit;h=44ab294e0b6f285f1aab5fc853...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Apr 16 12:21:09 2008 +0200
setupapi: Move strdupW and strdupWtoA to the setupapi_private.h header.
---
dlls/setupapi/queue.c | 23 ----------------------- dlls/setupapi/setupapi_private.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index e63639a..3212d5a 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -73,29 +73,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 ) { diff --git a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h index a3fe223..caf1d3b 100644 --- a/dlls/setupapi/setupapi_private.h +++ b/dlls/setupapi/setupapi_private.h @@ -29,6 +29,29 @@ #define REGPART_RENAME "\Rename" #define REG_VERSIONCONFLICT "Software\Microsoft\VersionConflictManager"
+static inline WCHAR *strdupW( const WCHAR *str ) +{ + WCHAR *ret = NULL; + if (str) + { + int len = (lstrlenW(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;