Quote:
Originally Posted by LCSBSSRHXXX
Actually looking back on it, it's writing &H2 over &H8 so it goes from
TOKEN_QUERY to TOKEN_ADJUST_PRIVILEGES
And not what was posted before.
|
Interesting...
The test:
Code:
#include <windows.h>
int main() {
int x = TOKEN_QUERY;
printf("TOKEN_QUERY == %d == %#X\n", x, x);
x = TOKEN_ADJUST_PRIVILEGES;
printf("TOKEN_ADJUST_PRIVILEGES == %d == %#X\n", x, x);
x = TOKEN_DUPLICATE;
printf("TOKEN_DUPLICATE == %d == %#X\n", x, x);
return 0;
}
The output:
Code:
TOKEN_QUERY == 8 == 0x8
TOKEN_ADJUST_PRIVILEGES == 32 == 0x20
TOKEN_DUPLICATE == 2 == 0x2
And it appears that a value of 2 is indeed TOKEN_DUPLICATE in this context, as I had originally stated. Does your compiler provide different definitions for these constants? I verified these with both the MinGW and the MS Visual C++ compiler headers.