Commit 381d30ac authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Add helpers to retrieve the system directory and OS architecture.

parent d8d6821c
...@@ -831,31 +831,37 @@ static void fill_processor( struct table *table ) ...@@ -831,31 +831,37 @@ static void fill_processor( struct table *table )
table->num_rows = count; table->num_rows = count;
} }
static void fill_os( struct table *table ) static const WCHAR *get_osarchitecture(void)
{ {
struct record_operatingsystem *rec;
WCHAR path[MAX_PATH];
SYSTEM_INFO info; SYSTEM_INFO info;
GetNativeSystemInfo( &info );
if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) return os_64bitW;
return os_32bitW;
}
static WCHAR *get_systemdirectory(void)
{
void *redir; void *redir;
WCHAR *ret;
if (!(table->data = heap_alloc( sizeof(*rec) ))) return; if (!(ret = heap_alloc( MAX_PATH * sizeof(WCHAR) ))) return NULL;
Wow64DisableWow64FsRedirection( &redir );
rec = (struct record_operatingsystem *)table->data; GetSystemDirectoryW( ret, MAX_PATH );
rec->caption = os_captionW; Wow64RevertWow64FsRedirection( redir );
rec->csdversion = os_csdversionW; return ret;
}
GetNativeSystemInfo( &info ); static void fill_os( struct table *table )
if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
rec->osarchitecture = os_64bitW; struct record_operatingsystem *rec;
else
rec->osarchitecture = os_32bitW;
rec->oslanguage = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); if (!(table->data = heap_alloc( sizeof(*rec) ))) return;
Wow64DisableWow64FsRedirection( &redir ); rec = (struct record_operatingsystem *)table->data;
GetSystemDirectoryW( path, MAX_PATH ); rec->caption = os_captionW;
Wow64RevertWow64FsRedirection( redir ); rec->csdversion = os_csdversionW;
rec->systemdirectory = heap_strdupW( path ); rec->osarchitecture = get_osarchitecture();
rec->oslanguage = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
rec->systemdirectory = get_systemdirectory();
TRACE("created 1 row\n"); TRACE("created 1 row\n");
table->num_rows = 1; table->num_rows = 1;
......
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