[PATCH v10 2/4] shell32: Move strdup functions to header file.
Alex Henrie
alexhenrie24 at gmail.com
Thu Aug 25 23:32:46 CDT 2016
Cc: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/shell32/shell32_main.h | 21 +++++++++++++++++++++
dlls/shell32/shelllink.c | 21 ---------------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 0178e10..3ca4506 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -188,6 +188,27 @@ static inline WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source)
return *target;
}
+/* strdup on the process heap */
+static inline LPWSTR heap_strdupAtoW( LPCSTR str )
+{
+ INT len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
+ LPWSTR p = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+ if( !p )
+ return p;
+ MultiByteToWideChar( CP_ACP, 0, str, -1, p, len );
+ return p;
+}
+
+static inline LPWSTR strdupW( LPCWSTR src )
+{
+ LPWSTR dest;
+ if (!src) return NULL;
+ dest = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(src)+1)*sizeof(WCHAR) );
+ if (dest)
+ lstrcpyW(dest, src);
+ return dest;
+}
+
extern WCHAR swShell32Name[MAX_PATH] DECLSPEC_HIDDEN;
diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c
index bd3507e..fa0a33a 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -204,27 +204,6 @@ static inline IShellLinkImpl *impl_from_IPropertyStore(IPropertyStore *iface)
static HRESULT ShellLink_UpdatePath(LPCWSTR sPathRel, LPCWSTR path, LPCWSTR sWorkDir, LPWSTR* psPath);
-/* strdup on the process heap */
-static inline LPWSTR heap_strdupAtoW( LPCSTR str)
-{
- INT len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
- LPWSTR p = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
- if( !p )
- return p;
- MultiByteToWideChar( CP_ACP, 0, str, -1, p, len );
- return p;
-}
-
-static inline LPWSTR strdupW( LPCWSTR src )
-{
- LPWSTR dest;
- if (!src) return NULL;
- dest = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(src)+1)*sizeof(WCHAR) );
- if (dest)
- lstrcpyW(dest, src);
- return dest;
-}
-
/**************************************************************************
* IPersistFile_QueryInterface
*/
--
2.9.3
More information about the wine-patches
mailing list