Skip to content

Commit 45a2bc6

Browse files
committed
Add flag macros
1 parent ec12f8b commit 45a2bc6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

phnt/include/phnt_ntdef.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,20 @@ typedef struct _KSYSTEM_TIME
333333

334334
#include <poppack.h>
335335

336+
// NT macros used to test, set and clear flags
337+
#ifndef FlagOn
338+
#define FlagOn(_F, _SF) ((_F) & (_SF))
339+
#endif
340+
#ifndef BooleanFlagOn
341+
#define BooleanFlagOn(F, SF) ((BOOLEAN)(((F) & (SF)) != 0))
342+
#endif
343+
#ifndef SetFlag
344+
#define SetFlag(_F, _SF) ((_F) |= (_SF))
345+
#endif
346+
#ifndef ClearFlag
347+
#define ClearFlag(_F, _SF) ((_F) &= ~(_SF))
348+
#endif
349+
336350
#endif
337351

338352
#endif

0 commit comments

Comments
 (0)