Skip to content

Commit fc8c710

Browse files
author
Paul Gofman
committed
fixup! wbemprox: Implement Win32_CacheMemory table.
CW-Bug-Id: #25276
1 parent 5466c27 commit fc8c710

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

dlls/wbemprox/builtin.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ static const struct column col_bios[] =
8787
};
8888
static const struct column col_cache_memory[] =
8989
{
90-
{ L"BlockSize", CIM_UINT64 },
91-
{ L"CacheSpeed", CIM_UINT32 },
92-
{ L"CacheType", CIM_UINT16 },
93-
{ L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC },
94-
{ L"InstalledSize", CIM_UINT32 },
95-
{ L"Level", CIM_UINT16 },
96-
{ L"MaxCacheSize", CIM_UINT32 },
90+
{ L"BlockSize", CIM_UINT64 },
91+
{ L"CacheSpeed", CIM_UINT32 },
92+
{ L"CacheType", CIM_UINT16 },
93+
{ L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC },
94+
{ L"InstalledSize", CIM_UINT32 },
95+
{ L"Level", CIM_UINT16 },
96+
{ L"MaxCacheSize", CIM_UINT32 },
9797
{ L"NumberOfBlocks", CIM_UINT64 },
98-
{ L"Status", CIM_STRING },
98+
{ L"Status", CIM_STRING },
9999
};
100100
static const struct column col_cdromdrive[] =
101101
{
@@ -552,14 +552,14 @@ struct record_bios
552552
};
553553
struct record_cache_memory
554554
{
555-
UINT64 block_size;
556-
UINT32 cache_speed;
557-
UINT16 cache_type;
555+
UINT64 block_size;
556+
UINT32 cache_speed;
557+
UINT16 cache_type;
558558
const WCHAR *device_id;
559-
UINT32 installed_size;
560-
UINT16 level;
561-
UINT32 max_cache_size;
562-
UINT64 number_of_blocks;
559+
UINT32 installed_size;
560+
UINT16 level;
561+
UINT32 max_cache_size;
562+
UINT64 number_of_blocks;
563563
const WCHAR *status;
564564
};
565565
struct record_cdromdrive
@@ -3472,28 +3472,28 @@ static UINT get_processor_maxclockspeed( UINT index )
34723472

34733473
static enum fill_status fill_cache_memory( struct table *table, const struct expr *cond )
34743474
{
3475-
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info = NULL, *info_end;
34763475
enum fill_status status = FILL_STATUS_UNFILTERED;
3476+
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info;
34773477
UINT i, idx, offset = 0, row_count = 0;
34783478
struct record_cache_memory *rec;
34793479
ULONG64 cache_size[16] = { 0 };
3480+
char *buffer = NULL;
34803481
DWORD size = 1024;
34813482
WCHAR str[64];
34823483

3483-
size = 1024;
34843484
while (1)
34853485
{
3486-
info = realloc( info, size );
3487-
if (GetLogicalProcessorInformationEx( RelationCache, info, &size )) break;
3486+
buffer = realloc( buffer, size );
3487+
if (GetLogicalProcessorInformationEx( RelationCache, (void *)buffer, &size )) break;
34883488
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
34893489
{
3490-
free( info );
3490+
free( buffer );
34913491
return FILL_STATUS_FAILED;
34923492
}
34933493
}
34943494

3495-
info_end = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)((char *)info + size);
3496-
while (info != info_end)
3495+
info = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)buffer;
3496+
while ((char *)info != buffer + size)
34973497
{
34983498
if (info->Cache.Level < ARRAY_SIZE(cache_size) && info->Cache.CacheSize)
34993499
{
@@ -3505,7 +3505,7 @@ static enum fill_status fill_cache_memory( struct table *table, const struct exp
35053505

35063506
if (!resize_table( table, row_count, sizeof(*rec) ))
35073507
{
3508-
free( info );
3508+
free( buffer );
35093509
return FILL_STATUS_FAILED;
35103510
}
35113511

@@ -3537,7 +3537,7 @@ static enum fill_status fill_cache_memory( struct table *table, const struct exp
35373537
}
35383538
TRACE("created %u rows\n", row_count);
35393539
table->num_rows = row_count;
3540-
free( info );
3540+
free( buffer );
35413541
return status;
35423542
}
35433543

0 commit comments

Comments
 (0)