mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 13:38:19 +00:00
[SDK][NDK][PSTYPES] Align the PROCESS_PRIORITY_CLASS structure during compile time (#2478)
CORE-16757 After doing investigations on the priority class structure alignment, it's been revealed that in Windows XP and Server 2003 this PROCESS_PRIORITY_CLASS structure is aligned as a 4-bytes of size hence NtQueryInformationProcess() probes the alignment of user mode arguments buffer output and buffer length with requirement of a ULONG. As PROCESS_PRIORITY_CLASS was initially aligned as a 1-byte size because both BOOLEAN and UCHAR are just unsigned characters, the compiler may not align such structure and gracefully let the default alignment of such structure as is, 1-byte because an unsigned char has a size of 1 byte. Setting an align attribute to this structure fixes the problem of a potential datatype misalignment which caused GetPriorityClass() to not retrieve the process' priority class properly.
This commit is contained in:
parent
2d36be4963
commit
7481bda679
1 changed files with 1 additions and 1 deletions
|
@ -902,7 +902,7 @@ typedef struct _PROCESS_SESSION_INFORMATION
|
|||
|
||||
#endif
|
||||
|
||||
typedef struct _PROCESS_PRIORITY_CLASS
|
||||
typedef struct DECLSPEC_ALIGN(4) _PROCESS_PRIORITY_CLASS
|
||||
{
|
||||
BOOLEAN Foreground;
|
||||
UCHAR PriorityClass;
|
||||
|
|
Loading…
Reference in a new issue