Commit dba0dd41 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Build with msvcrt.

parent 4f8dfdba
MODULE = wbemprox.dll
IMPORTS = winspool version iphlpapi dxgi oleaut32 ole32 advapi32 user32 gdi32 ws2_32 rpcrt4 setupapi
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \
builtin.c \
class.c \
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -586,7 +585,7 @@ static BSTR get_body_text( const struct table *table, UINT row, UINT *len )
if ((value = get_value_bstr( table, row, i )))
{
*len += ARRAY_SIZE( fmtW );
*len += strlenW( table->columns[i].name );
*len += lstrlenW( table->columns[i].name );
*len += SysStringLen( value );
SysFreeString( value );
}
......@@ -597,7 +596,7 @@ static BSTR get_body_text( const struct table *table, UINT row, UINT *len )
{
if ((value = get_value_bstr( table, row, i )))
{
p += sprintfW( p, fmtW, table->columns[i].name, value );
p += swprintf( p, *len - (p - ret), fmtW, table->columns[i].name, value );
SysFreeString( value );
}
}
......@@ -612,12 +611,12 @@ static BSTR get_object_text( const struct view *view, UINT index )
BSTR ret, body;
len = ARRAY_SIZE( fmtW );
len += strlenW( view->table->name );
len += lstrlenW( view->table->name );
if (!(body = get_body_text( view->table, row, &len_body ))) return NULL;
len += len_body;
if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
sprintfW( ret, fmtW, view->table->name, body );
swprintf( ret, len, fmtW, view->table->name, body );
SysFreeString( body );
return ret;
}
......@@ -807,12 +806,12 @@ static WCHAR *build_signature_table_name( const WCHAR *class, const WCHAR *metho
static const WCHAR fmtW[] = {'_','_','%','s','_','%','s','_','%','s',0};
static const WCHAR outW[] = {'O','U','T',0};
static const WCHAR inW[] = {'I','N',0};
UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + strlenW( class ) + strlenW( method );
UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + lstrlenW( class ) + lstrlenW( method );
WCHAR *ret;
if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
sprintfW( ret, fmtW, class, method, dir == PARAM_IN ? inW : outW );
return struprW( ret );
swprintf( ret, len, fmtW, class, method, dir == PARAM_IN ? inW : outW );
return wcsupr( ret );
}
HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_direction dir,
......@@ -831,9 +830,9 @@ HRESULT create_signature( const WCHAR *class, const WCHAR *method, enum param_di
WCHAR *query, *name;
HRESULT hr;
len += strlenW( class ) + strlenW( method );
len += lstrlenW( class ) + lstrlenW( method );
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
sprintfW( query, selectW, class, method, dir >= 0 ? geW : leW );
swprintf( query, len, selectW, class, method, dir >= 0 ? geW : leW );
hr = exec_query( query, &iter );
heap_free( query );
......
......@@ -17,8 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
......
......@@ -20,7 +20,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -108,13 +107,13 @@ static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, c
int len;
if (!member) member = noneW;
len = strlenW( class ) + strlenW( member );
if (name) len += strlenW( name ) + ARRAY_SIZE(fmtW);
len = lstrlenW( class ) + lstrlenW( member );
if (name) len += lstrlenW( name ) + ARRAY_SIZE(fmtW);
else len += ARRAY_SIZE(fmt2W);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
if (name) sprintfW( query, fmtW, class, member, name );
else sprintfW( query, fmt2W, class, member );
if (name) swprintf( query, len, fmtW, class, member, name );
else swprintf( query, len, fmt2W, class, member );
hr = exec_query( query, iter );
heap_free( query );
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -63,10 +62,10 @@ static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr )
{
while (*q == '%') q++;
if (!*q) return TRUE;
while (*p && *q && toupperW( *p ) == toupperW( *q )) { p++; q++; };
while (*p && *q && towupper( *p ) == towupper( *q )) { p++; q++; };
if (!*p && !*q) return TRUE;
}
if (*q != '%' && toupperW( *p++ ) != toupperW( *q++ )) return FALSE;
if (*q != '%' && towupper( *p++ ) != towupper( *q++ )) return FALSE;
}
return TRUE;
}
......@@ -81,22 +80,22 @@ static HRESULT eval_strcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGL
switch (op)
{
case OP_EQ:
*val = !strcmpW( lstr, rstr );
*val = !wcscmp( lstr, rstr );
break;
case OP_GT:
*val = strcmpW( lstr, rstr ) > 0;
*val = wcscmp( lstr, rstr ) > 0;
break;
case OP_LT:
*val = strcmpW( lstr, rstr ) < 0;
*val = wcscmp( lstr, rstr ) < 0;
break;
case OP_LE:
*val = strcmpW( lstr, rstr ) <= 0;
*val = wcscmp( lstr, rstr ) <= 0;
break;
case OP_GE:
*val = strcmpW( lstr, rstr ) >= 0;
*val = wcscmp( lstr, rstr ) >= 0;
break;
case OP_NE:
*val = strcmpW( lstr, rstr );
*val = wcscmp( lstr, rstr );
break;
case OP_LIKE:
*val = eval_like( lstr, rstr );
......@@ -148,8 +147,8 @@ static HRESULT eval_boolcmp( UINT op, LONGLONG lval, LONGLONG rval, UINT ltype,
{
static const WCHAR trueW[] = {'T','r','u','e',0};
if (ltype == CIM_STRING) lval = !strcmpiW( (const WCHAR *)(INT_PTR)lval, trueW ) ? -1 : 0;
else if (rtype == CIM_STRING) rval = !strcmpiW( (const WCHAR *)(INT_PTR)rval, trueW ) ? -1 : 0;
if (ltype == CIM_STRING) lval = !wcsicmp( (const WCHAR *)(INT_PTR)lval, trueW ) ? -1 : 0;
else if (rtype == CIM_STRING) rval = !wcsicmp( (const WCHAR *)(INT_PTR)rval, trueW ) ? -1 : 0;
switch (op)
{
......@@ -207,7 +206,7 @@ static UINT resolve_type( UINT left, UINT right )
return CIM_ILLEGAL;
}
static const WCHAR *format_int( WCHAR *buf, CIMTYPE type, LONGLONG val )
static const WCHAR *format_int( WCHAR *buf, UINT len, CIMTYPE type, LONGLONG val )
{
static const WCHAR fmt_signedW[] = {'%','d',0};
static const WCHAR fmt_unsignedW[] = {'%','u',0};
......@@ -219,13 +218,13 @@ static const WCHAR *format_int( WCHAR *buf, CIMTYPE type, LONGLONG val )
case CIM_SINT8:
case CIM_SINT16:
case CIM_SINT32:
sprintfW( buf, fmt_signedW, val );
swprintf( buf, len, fmt_signedW, val );
return buf;
case CIM_UINT8:
case CIM_UINT16:
case CIM_UINT32:
sprintfW( buf, fmt_unsignedW, val );
swprintf( buf, len, fmt_unsignedW, val );
return buf;
case CIM_SINT64:
......@@ -263,10 +262,10 @@ static HRESULT eval_binary( const struct table *table, UINT row, const struct co
const WCHAR *lstr, *rstr;
WCHAR lbuf[21], rbuf[21];
if (is_int( ltype )) lstr = format_int( lbuf, ltype, lval );
if (is_int( ltype )) lstr = format_int( lbuf, ARRAY_SIZE( lbuf ), ltype, lval );
else lstr = (const WCHAR *)(INT_PTR)lval;
if (is_int( rtype )) rstr = format_int( rbuf, rtype, rval );
if (is_int( rtype )) rstr = format_int( rbuf, ARRAY_SIZE( rbuf ), rtype, rval );
else rstr = (const WCHAR *)(INT_PTR)rval;
return eval_strcmp( expr->op, lstr, rstr, val );
......@@ -493,7 +492,7 @@ BOOL is_selected_prop( const struct view *view, const WCHAR *name )
if (!prop) return TRUE;
while (prop)
{
if (!strcmpiW( prop->name, name )) return TRUE;
if (!wcsicmp( prop->name, name )) return TRUE;
prop = prop->next;
}
return FALSE;
......@@ -512,7 +511,7 @@ static BSTR build_servername( const struct view *view )
if (view->proplist) return NULL;
if (!(GetComputerNameW( server, &len ))) return NULL;
for (p = server; *p; p++) *p = toupperW( *p );
for (p = server; *p; p++) *p = towupper( *p );
return SysAllocString( server );
}
......@@ -545,7 +544,7 @@ static BSTR build_proplist( const struct view *view, UINT index, UINT count, UIN
const WCHAR *name = view->table->columns[i].name;
values[j] = get_value_bstr( view->table, row, i );
*len += strlenW( fmtW ) + strlenW( name ) + strlenW( values[j] );
*len += lstrlenW( fmtW ) + lstrlenW( name ) + lstrlenW( values[j] );
j++;
}
}
......@@ -558,7 +557,7 @@ static BSTR build_proplist( const struct view *view, UINT index, UINT count, UIN
{
const WCHAR *name = view->table->columns[i].name;
offset += sprintfW( ret + offset, fmtW, name, values[j] );
offset += swprintf( ret + offset, *len - offset, fmtW, name, values[j] );
if (j < count - 1) ret[offset++] = ',';
j++;
}
......@@ -592,9 +591,9 @@ static BSTR build_relpath( const struct view *view, UINT index, const WCHAR *nam
if (!(num_keys = count_key_columns( view ))) return class;
if (!(proplist = build_proplist( view, index, num_keys, &len ))) goto done;
len += strlenW( fmtW ) + SysStringLen( class );
len += lstrlenW( fmtW ) + SysStringLen( class );
if (!(ret = SysAllocStringLen( NULL, len ))) goto done;
sprintfW( ret, fmtW, class, proplist );
swprintf( ret, len, fmtW, class, proplist );
done:
SysFreeString( class );
......@@ -614,9 +613,9 @@ static BSTR build_path( const struct view *view, UINT index, const WCHAR *name )
if (!(namespace = build_namespace( view ))) goto done;
if (!(relpath = build_relpath( view, index, name ))) goto done;
len = strlenW( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + SysStringLen( relpath );
len = lstrlenW( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + SysStringLen( relpath );
if (!(ret = SysAllocStringLen( NULL, len ))) goto done;
sprintfW( ret, fmtW, server, namespace, relpath );
swprintf( ret, len, fmtW, server, namespace, relpath );
done:
SysFreeString( server );
......@@ -666,7 +665,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (flavor) *flavor = WBEM_FLAVOR_ORIGIN_SYSTEM;
if (!strcmpiW( name, classW ))
if (!wcsicmp( name, classW ))
{
if (ret)
{
......@@ -676,7 +675,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, genusW ))
if (!wcsicmp( name, genusW ))
{
if (ret)
{
......@@ -686,7 +685,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, namespaceW ))
else if (!wcsicmp( name, namespaceW ))
{
if (ret)
{
......@@ -696,7 +695,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, pathW ))
else if (!wcsicmp( name, pathW ))
{
if (ret)
{
......@@ -706,7 +705,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, propcountW ))
if (!wcsicmp( name, propcountW ))
{
if (ret)
{
......@@ -716,7 +715,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, relpathW ))
else if (!wcsicmp( name, relpathW ))
{
if (ret)
{
......@@ -726,7 +725,7 @@ static HRESULT get_system_propval( const struct view *view, UINT index, const WC
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, serverW ))
else if (!wcsicmp( name, serverW ))
{
if (ret)
{
......
......@@ -20,7 +20,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......
......@@ -20,7 +20,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......
......@@ -20,7 +20,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -27,7 +26,6 @@
#include "wbemcli.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
......@@ -279,7 +277,7 @@ static HRESULT WINAPI wbem_services_OpenNamespace(
TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strNamespace), lFlags,
pCtx, ppWorkingNamespace, ppResult);
if ((strcmpiW( strNamespace, cimv2W ) && strcmpiW( strNamespace, defaultW )) || ws->namespace)
if ((wcsicmp( strNamespace, cimv2W ) && wcsicmp( strNamespace, defaultW )) || ws->namespace)
return WBEM_E_INVALID_NAMESPACE;
return WbemServices_create( cimv2W, (void **)ppWorkingNamespace );
......@@ -422,14 +420,14 @@ static WCHAR *query_from_path( const struct path *path )
{
len = path->class_len + path->filter_len + ARRAY_SIZE(selectW);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
sprintfW( query, selectW, path->class, path->filter );
swprintf( query, len, selectW, path->class, path->filter );
}
else
{
len = path->class_len + ARRAY_SIZE(select_allW);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
strcpyW( query, select_allW );
strcatW( query, path->class );
lstrcpyW( query, select_allW );
lstrcatW( query, path->class );
}
return query;
}
......@@ -653,7 +651,7 @@ static HRESULT WINAPI wbem_services_ExecQuery(
debugstr_w(strQuery), lFlags, pCtx, ppEnum);
if (!strQueryLanguage || !strQuery || !strQuery[0]) return WBEM_E_INVALID_PARAMETER;
if (strcmpiW( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE;
if (wcsicmp( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE;
return exec_query( strQuery, ppEnum );
}
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -35,7 +34,7 @@ HRESULT get_column_index( const struct table *table, const WCHAR *name, UINT *co
UINT i;
for (i = 0; i < table->num_cols; i++)
{
if (!strcmpiW( table->columns[i].name, name ))
if (!wcsicmp( table->columns[i].name, name ))
{
*column = i;
return S_OK;
......@@ -176,19 +175,19 @@ BSTR get_value_bstr( const struct table *table, UINT row, UINT column )
case CIM_DATETIME:
case CIM_STRING:
if (!val) return NULL;
len = strlenW( (const WCHAR *)(INT_PTR)val ) + 2;
len = lstrlenW( (const WCHAR *)(INT_PTR)val ) + 2;
if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
sprintfW( ret, fmt_strW, (const WCHAR *)(INT_PTR)val );
swprintf( ret, len, fmt_strW, (const WCHAR *)(INT_PTR)val );
return ret;
case CIM_SINT16:
case CIM_SINT32:
sprintfW( number, fmt_signedW, val );
swprintf( number, ARRAY_SIZE( number ), fmt_signedW, val );
return SysAllocString( number );
case CIM_UINT16:
case CIM_UINT32:
sprintfW( number, fmt_unsignedW, val );
swprintf( number, ARRAY_SIZE( number ), fmt_unsignedW, val );
return SysAllocString( number );
case CIM_SINT64:
......@@ -263,7 +262,7 @@ HRESULT get_method( const struct table *table, const WCHAR *name, class_method *
{
for (j = 0; j < table->num_cols; j++)
{
if (table->columns[j].type & COL_FLAG_METHOD && !strcmpW( table->columns[j].name, name ))
if (table->columns[j].type & COL_FLAG_METHOD && !wcscmp( table->columns[j].name, name ))
{
HRESULT hr;
LONGLONG val;
......@@ -357,7 +356,7 @@ struct table *grab_table( const WCHAR *name )
LIST_FOR_EACH_ENTRY( table, table_list, struct table, entry )
{
if (name && !strcmpiW( table->name, name ))
if (name && !wcsicmp( table->name, name ))
{
TRACE("returning %p\n", table);
return addref_table( table );
......@@ -392,7 +391,7 @@ BOOL add_table( struct table *table )
LIST_FOR_EACH_ENTRY( iter, table_list, struct table, entry )
{
if (!strcmpiW( iter->name, table->name ))
if (!wcsicmp( iter->name, table->name ))
{
TRACE("table %s already exists\n", debugstr_w(table->name));
return FALSE;
......
......@@ -18,7 +18,6 @@
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -27,7 +26,6 @@
#include "wbemcli.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
......@@ -93,8 +91,8 @@ static BOOL is_local_machine( const WCHAR *server )
WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 1];
DWORD len = ARRAY_SIZE( buffer );
if (!server || !strcmpW( server, dotW ) || !strcmpiW( server, localhostW )) return TRUE;
if (GetComputerNameW( buffer, &len ) && !strcmpiW( server, buffer )) return TRUE;
if (!server || !wcscmp( server, dotW ) || !wcsicmp( server, localhostW )) return TRUE;
if (GetComputerNameW( buffer, &len ) && !wcsicmp( server, buffer )) return TRUE;
return FALSE;
}
......@@ -133,15 +131,15 @@ static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **na
p = q;
while (*q && *q != '\\' && *q != '/') q++;
len = q - p;
if (len >= ARRAY_SIZE( rootW ) && strncmpiW( rootW, p, len )) goto done;
if (len >= ARRAY_SIZE( rootW ) && wcsnicmp( rootW, p, len )) goto done;
if (!*q)
{
hr = S_OK;
goto done;
}
q++;
len = strlenW( q );
if (strcmpiW( q, cimv2W ) && strcmpiW( q, defaultW ))
len = lstrlenW( q );
if (wcsicmp( q, cimv2W ) && wcsicmp( q, defaultW ))
goto done;
if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
......
......@@ -19,7 +19,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
IClientSecurity client_security DECLSPEC_HIDDEN;
struct list *table_list DECLSPEC_HIDDEN;
......@@ -240,7 +239,7 @@ static inline WCHAR *heap_strdupW( const WCHAR *src )
{
WCHAR *dst;
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;
}
......
......@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
......@@ -28,7 +27,6 @@
#include "wine/list.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
......@@ -666,13 +664,13 @@ static const struct wql_keyword keyword_table[] =
{ whereW, ARRAY_SIZE(whereW), TK_WHERE }
};
static int cmp_keyword( const void *arg1, const void *arg2 )
static int __cdecl cmp_keyword( const void *arg1, const void *arg2 )
{
const struct wql_keyword *key1 = arg1, *key2 = arg2;
int len = min( key1->len, key2->len );
int ret;
if ((ret = strncmpiW( key1->name, key2->name, len ))) return ret;
if ((ret = wcsnicmp( key1->name, key2->name, len ))) return ret;
if (key1->len < key2->len) return -1;
else if (key1->len > key2->len) return 1;
return 0;
......@@ -702,7 +700,7 @@ static int get_token( const WCHAR *s, int *token )
case '\t':
case '\r':
case '\n':
for (i = 1; isspaceW( s[i] ); i++) {}
for (i = 1; iswspace( s[i] ); i++) {}
*token = TK_SPACE;
return i;
case '-':
......@@ -781,7 +779,7 @@ static int get_token( const WCHAR *s, int *token )
*token = TK_STRING;
return i;
case '.':
if (!isdigitW( s[1] ))
if (!iswdigit( s[1] ))
{
*token = TK_DOT;
return 1;
......@@ -790,7 +788,7 @@ static int get_token( const WCHAR *s, int *token )
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
*token = TK_INTEGER;
for (i = 1; isdigitW( s[i] ); i++) {}
for (i = 1; iswdigit( s[i] ); i++) {}
return i;
default:
if (!id_char[*s]) break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment