[1/2] wininet: Implement WININET_strndupW
Mike Ruprecht
cmaiku at gmail.com
Mon Dec 15 20:30:21 CST 2008
---
dlls/wininet/internet.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h
index 8de85ff..aabd8aa 100644
--- a/dlls/wininet/internet.h
+++ b/dlls/wininet/internet.h
@@ -65,6 +65,16 @@ static inline LPWSTR WININET_strdupW( LPCWSTR str )
return ret;
}
+static inline LPWSTR WININET_strndupW( LPCWSTR str, INT len )
+{
+ LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, (len +
1)*sizeof(WCHAR) );
+ if (str && ret) {
+ memcpy( ret, str, len*sizeof(WCHAR) );
+ ret[len] = 0;
+ }
+ return ret;
+}
+
static inline LPWSTR WININET_strdup_AtoW( LPCSTR str )
{
int len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0);
More information about the wine-patches
mailing list