Commit dbf8751
committed
Drop definition of PSAPI_WORKING_SET_EX_BLOCK, move functions to PSAPI_WORKING_SET_EX_INFORMATION, adjust function names
The definition of PSAPI_WORKING_SET_EX_BLOCK was not correct. The outer
definition is a UNION with two members:
- ULONG_PTR Flags and
- another anonymous union holding two bitfield definitions
It effectively defines a union with 3 defintions.
The bitfield definition differs between 32bit and 64bit. The 32bit
version defines data elements filling exactly the 32bits a single
ULONG_PTR can hold. The 64bit version adds an additional 32bit reserved
element, which agains fill the full size a single ULONG_PTR can hold on
64bit.
The two bitfield definitions both map to ULONG_PTR, so
PSAPI_WORKING_SET_EX_BLOCK is basicly just a ULONG_PTR with C syntactic
sugar for decoding.
The PSAPI_WORKING_SET_EX_BLOCK is only used in
PSAPI_WORKING_SET_EX_INFORMATION and given that the union definition
of PSAPI_WORKING_SET_EX_BLOCK is syntactic sugar, we can drop the
definition and integrate the decoding logic directly into
PSAPI_WORKING_SET_EX_INFORMATION.
-----------------------------------------------------------------------
typedef struct _PSAPI_WORKING_SET_EX_INFORMATION {
PVOID VirtualAddress;
PSAPI_WORKING_SET_EX_BLOCK VirtualAttributes;
} PSAPI_WORKING_SET_EX_INFORMATION, *PPSAPI_WORKING_SET_EX_INFORMATION;
typedef union _PSAPI_WORKING_SET_EX_BLOCK {
ULONG_PTR Flags;
union {
struct {
ULONG_PTR Valid : 1;
ULONG_PTR ShareCount : 3;
ULONG_PTR Win32Protection : 11;
ULONG_PTR Shared : 1;
ULONG_PTR Node : 6;
ULONG_PTR Locked : 1;
ULONG_PTR LargePage : 1;
ULONG_PTR Reserved : 7;
ULONG_PTR Bad : 1;
#if defined(_WIN64)
ULONG_PTR ReservedUlong : 32;
#endif
};
struct {
ULONG_PTR Valid : 1; // Valid = 0 in this format.
ULONG_PTR Reserved0 : 14;
ULONG_PTR Shared : 1;
ULONG_PTR Reserved1 : 15;
ULONG_PTR Bad : 1;
#if defined(_WIN64)
ULONG_PTR ReservedUlong : 32;
#endif
} Invalid;
};
} PSAPI_WORKING_SET_EX_BLOCK, *PPSAPI_WORKING_SET_EX_BLOCK;1 parent d4ccd5c commit dbf8751
1 file changed
+27
-32
lines changedLines changed: 27 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 338 | + | |
| 339 | + | |
343 | 340 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 341 | + | |
| 342 | + | |
349 | 343 | | |
350 | 344 | | |
351 | | - | |
| 345 | + | |
| 346 | + | |
352 | 347 | | |
353 | | - | |
| 348 | + | |
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
357 | 352 | | |
358 | | - | |
| 353 | + | |
| 354 | + | |
359 | 355 | | |
360 | | - | |
| 356 | + | |
361 | 357 | | |
362 | 358 | | |
363 | 359 | | |
364 | 360 | | |
365 | | - | |
366 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
| 403 | + | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
| 409 | + | |
409 | 410 | | |
| 411 | + | |
410 | 412 | | |
411 | 413 | | |
412 | 414 | | |
| |||
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
420 | | - | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | 425 | | |
0 commit comments