[WMIUTILS] Sync with Wine Staging 4.18. CORE-16441

This commit is contained in:
Amine Khaldi 2019-12-07 13:10:01 +01:00
parent 6b9bd93fe6
commit bd00327109
5 changed files with 28 additions and 33 deletions

View file

@ -16,7 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#define COBJMACROS #define COBJMACROS

View file

@ -18,7 +18,6 @@
#define COBJMACROS #define COBJMACROS
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
@ -379,7 +378,7 @@ static HRESULT parse_key( struct key *key, const WCHAR *str, unsigned int *ret_l
p = q = str; p = q = str;
while (*q && *q != '=') while (*q && *q != '=')
{ {
if (*q == ',' || isspaceW( *q )) return WBEM_E_INVALID_PARAMETER; if (*q == ',' || iswspace( *q )) return WBEM_E_INVALID_PARAMETER;
q++; q++;
} }
len = q - p; len = q - p;
@ -389,7 +388,7 @@ static HRESULT parse_key( struct key *key, const WCHAR *str, unsigned int *ret_l
key->len_name = len; key->len_name = len;
p = ++q; p = ++q;
if (!*p || *p == ',' || isspaceW( *p )) return WBEM_E_INVALID_PARAMETER; if (!*p || *p == ',' || iswspace( *p )) return WBEM_E_INVALID_PARAMETER;
while (*q && *q != ',') q++; while (*q && *q != ',') q++;
len = q - p; len = q - p;
@ -423,7 +422,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
path->flags |= WBEMPATH_INFO_PATH_HAD_SERVER; path->flags |= WBEMPATH_INFO_PATH_HAD_SERVER;
} }
p = q; p = q;
if (strchrW( p, '\\' ) || strchrW( p, '/' )) if (wcschr( p, '\\' ) || wcschr( p, '/' ))
{ {
if (*q != '\\' && *q != '/' && *q != ':') if (*q != '\\' && *q != '/' && *q != ':')
{ {
@ -528,14 +527,14 @@ static HRESULT WINAPI path_SetText(
if (!pszPath[0]) goto done; if (!pszPath[0]) goto done;
if ((hr = parse_text( path, uMode, pszPath )) != S_OK) goto done; if ((hr = parse_text( path, uMode, pszPath )) != S_OK) goto done;
len = strlenW( pszPath ); len = lstrlenW( pszPath );
if (!(path->text = heap_alloc( (len + 1) * sizeof(WCHAR) ))) if (!(path->text = heap_alloc( (len + 1) * sizeof(WCHAR) )))
{ {
clear_path( path ); clear_path( path );
hr = E_OUTOFMEMORY; hr = E_OUTOFMEMORY;
goto done; goto done;
} }
strcpyW( path->text, pszPath ); lstrcpyW( path->text, pszPath );
path->len_text = len; path->len_text = len;
done: done:
@ -576,7 +575,7 @@ static WCHAR *build_server( struct path *path, int *len )
if (path->len_server) if (path->len_server)
{ {
p[0] = p[1] = '\\'; p[0] = p[1] = '\\';
strcpyW( p + 2, path->server ); lstrcpyW( p + 2, path->server );
} }
else else
{ {
@ -641,15 +640,15 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
heap_free( keylist ); heap_free( keylist );
return NULL; return NULL;
} }
strcpyW( ret, namespace ); lstrcpyW( ret, namespace );
if (path->len_class) if (path->len_class)
{ {
ret[len_namespace] = ':'; ret[len_namespace] = ':';
strcpyW( ret + len_namespace + 1, path->class ); lstrcpyW( ret + len_namespace + 1, path->class );
if (path->num_keys) if (path->num_keys)
{ {
ret[len_namespace + path->len_class + 1] = '.'; ret[len_namespace + path->len_class + 1] = '.';
strcpyW( ret + len_namespace + path->len_class + 2, keylist ); lstrcpyW( ret + len_namespace + path->len_class + 2, keylist );
} }
} }
heap_free( namespace ); heap_free( namespace );
@ -672,11 +671,11 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
heap_free( keylist ); heap_free( keylist );
return NULL; return NULL;
} }
strcpyW( ret, path->class ); lstrcpyW( ret, path->class );
if (path->num_keys) if (path->num_keys)
{ {
ret[path->len_class] = '.'; ret[path->len_class] = '.';
strcpyW( ret + path->len_class + 1, keylist ); lstrcpyW( ret + path->len_class + 1, keylist );
} }
heap_free( keylist ); heap_free( keylist );
return ret; return ret;
@ -708,18 +707,18 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
heap_free( keylist ); heap_free( keylist );
return NULL; return NULL;
} }
strcpyW( p, server ); lstrcpyW( p, server );
p += len_server; p += len_server;
strcpyW( p, namespace ); lstrcpyW( p, namespace );
p += len_namespace; p += len_namespace;
if (path->len_class) if (path->len_class)
{ {
*p++ = ':'; *p++ = ':';
strcpyW( p, path->class ); lstrcpyW( p, path->class );
if (path->num_keys) if (path->num_keys)
{ {
p[path->len_class] = '.'; p[path->len_class] = '.';
strcpyW( p + path->len_class + 1, keylist ); lstrcpyW( p + path->len_class + 1, keylist );
} }
} }
heap_free( namespace ); heap_free( namespace );
@ -746,9 +745,9 @@ static WCHAR *build_path( struct path *path, LONG flags, int *len )
heap_free( server ); heap_free( server );
return NULL; return NULL;
} }
strcpyW( p, server ); lstrcpyW( p, server );
p += len_server; p += len_server;
strcpyW( p, namespace ); lstrcpyW( p, namespace );
heap_free( namespace ); heap_free( namespace );
heap_free( server ); heap_free( server );
return ret; return ret;
@ -795,7 +794,7 @@ static HRESULT WINAPI path_GetText(
hr = WBEM_E_INVALID_PARAMETER; hr = WBEM_E_INVALID_PARAMETER;
goto done; goto done;
} }
if (str) strcpyW( pszText, str ); if (str) lstrcpyW( pszText, str );
else pszText[0] = 0; else pszText[0] = 0;
*puBufferLength = len + 1; *puBufferLength = len + 1;
@ -866,7 +865,7 @@ static HRESULT WINAPI path_SetServer(
} }
heap_free( path->server ); heap_free( path->server );
path->server = server; path->server = server;
path->len_server = strlenW( path->server ); path->len_server = lstrlenW( path->server );
path->flags |= flags; path->flags |= flags;
} }
else else
@ -899,7 +898,7 @@ static HRESULT WINAPI path_GetServer(
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
return WBEM_E_NOT_AVAILABLE; return WBEM_E_NOT_AVAILABLE;
} }
if (*len > path->len_server) strcpyW( name, path->server ); if (*len > path->len_server) lstrcpyW( name, path->server );
*len = path->len_server + 1; *len = path->len_server + 1;
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
@ -975,7 +974,7 @@ static HRESULT WINAPI path_SetNamespaceAt(
path->len_namespaces[i + 1] = path->len_namespaces[i]; path->len_namespaces[i + 1] = path->len_namespaces[i];
} }
path->namespaces[idx] = new; path->namespaces[idx] = new;
path->len_namespaces[idx] = strlenW( new ); path->len_namespaces[idx] = lstrlenW( new );
path->num_namespaces++; path->num_namespaces++;
path->flags |= flags; path->flags |= flags;
@ -1000,7 +999,7 @@ static HRESULT WINAPI path_GetNamespaceAt(
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
return WBEM_E_INVALID_PARAMETER; return WBEM_E_INVALID_PARAMETER;
} }
if (*len > path->len_namespaces[idx]) strcpyW( name, path->namespaces[idx] ); if (*len > path->len_namespaces[idx]) lstrcpyW( name, path->namespaces[idx] );
*len = path->len_namespaces[idx] + 1; *len = path->len_namespaces[idx] + 1;
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
@ -1134,7 +1133,7 @@ static HRESULT WINAPI path_SetClassName(
heap_free( path->class ); heap_free( path->class );
path->class = class; path->class = class;
path->len_class = strlenW( path->class ); path->len_class = lstrlenW( path->class );
path->flags |= WBEMPATH_INFO_V2_COMPLIANT | WBEMPATH_INFO_CIM_COMPLIANT; path->flags |= WBEMPATH_INFO_V2_COMPLIANT | WBEMPATH_INFO_CIM_COMPLIANT;
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
@ -1159,7 +1158,7 @@ static HRESULT WINAPI path_GetClassName(
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );
return WBEM_E_INVALID_OBJECT_PATH; return WBEM_E_INVALID_OBJECT_PATH;
} }
if (*len > path->len_class) strcpyW( name, path->class ); if (*len > path->len_class) lstrcpyW( name, path->class );
*len = path->len_class + 1; *len = path->len_class + 1;
LeaveCriticalSection( &path->cs ); LeaveCriticalSection( &path->cs );

View file

@ -18,7 +18,6 @@
#define COBJMACROS #define COBJMACROS
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -28,7 +27,6 @@
#include "wbemcli.h" #include "wbemcli.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "wmiutils_private.h" #include "wmiutils_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmiutils); WINE_DEFAULT_DEBUG_CHANNEL(wmiutils);
@ -100,7 +98,7 @@ static HRESULT WINAPI status_code_GetErrorCodeText(
FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text); FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text);
sprintfW(msg, fmt, res); swprintf(msg, fmt, res);
*text = SysAllocString(msg); *text = SysAllocString(msg);
return WBEM_S_NO_ERROR; return WBEM_S_NO_ERROR;
} }
@ -118,7 +116,7 @@ static HRESULT WINAPI status_code_GetFacilityCodeText(
FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text); FIXME("%p, 0x%08x, 0x%04x, 0x%08x, %p\n", iface, res, lcid, flags, text);
sprintfW(msg, fmt, res); swprintf(msg, fmt, res);
*text = SysAllocString(msg); *text = SysAllocString(msg);
return WBEM_S_NO_ERROR; return WBEM_S_NO_ERROR;
} }

View file

@ -17,7 +17,6 @@
*/ */
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/unicode.h"
HRESULT WbemPath_create(LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemPath_create(LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemStatusCodeText_create(LPVOID *) DECLSPEC_HIDDEN; HRESULT WbemStatusCodeText_create(LPVOID *) DECLSPEC_HIDDEN;
@ -26,6 +25,6 @@ static inline WCHAR *strdupW( const WCHAR *src )
{ {
WCHAR *dst; WCHAR *dst;
if (!src) return NULL; if (!src) return NULL;
if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src ); if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src );
return dst; return dst;
} }

View file

@ -210,7 +210,7 @@ dll/win32/winscard # Synced to WineStaging-4.18
dll/win32/wintrust # Synced to WineStaging-4.18 dll/win32/wintrust # Synced to WineStaging-4.18
dll/win32/wldap32 # Synced to WineStaging-4.18 dll/win32/wldap32 # Synced to WineStaging-4.18
dll/win32/wmi # Synced to WineStaging-2.9 dll/win32/wmi # Synced to WineStaging-2.9
dll/win32/wmiutils # Synced to WineStaging-3.3 dll/win32/wmiutils # Synced to WineStaging-4.18
dll/win32/wmvcore # Synced to WineStaging-3.9 dll/win32/wmvcore # Synced to WineStaging-3.9
dll/win32/wshom.ocx # Synced to WineStaging-3.3 dll/win32/wshom.ocx # Synced to WineStaging-3.3
dll/win32/wtsapi32 # Synced to WineStaging-3.9 dll/win32/wtsapi32 # Synced to WineStaging-3.9