Suppose that a DWORD has the value of (FLAG_ONE | FLAG_TWO | FLAG_3). How can I tell if it DWORD contains the value of FLAG_TWO or not?
In other words, how do I separate a DWORD into its '|'-delimited flags?
Here's pseudo-code for I want:
1 2 3 4
if(dwFlags.contains(PROCESS_TERMINATE)) // if PROCESS_TERMINATE is one of its flags
printf("yay, you can terminate the process!");
else
printf("nope, you can't terminate it.");
EDIT: This only works if the flag is an individual bit (which is typically the case), however if you have a compound flag that is really several bits, this won't work.