typedef wchar_t *PWSTR;
typedef unsigned char *PUCHAR;
typedef unsigned short *PUSHORT;
-typedef void *PVOID;
+/* Prevent: warning: dereferencing type-punned pointer will break strict-aliasing rules
+ * As PVOID is usually used for untyped generalized casts.
+ */
+typedef void __attribute__((__may_alias__)) *PVOID;
typedef unsigned char BYTE;
typedef void *LPVOID;
typedef float *PFLOAT;
if (Handle == NtCurrentProcess() &&
(ObjectType == PsProcessType || ObjectType == NULL))
{
+/* FIXME: How to prevent?: warning: dereferencing type-punned pointer will break strict-aliasing rules
+ * '__attribute__((__may_alias__))' for 'PULONG' does not work.
+ */
+#if 0
DPRINT("Reference from %x\n", ((PULONG)&Handle)[-1]);
+#endif
Status = ObReferenceObjectByPointer(PsGetCurrentProcess(),
PROCESS_ALL_ACCESS,
if (ObjectHeader->ObjectType == PsProcessType)
{
+/* FIXME: How to prevent?: warning: dereferencing type-punned pointer will break strict-aliasing rules
+ * '__attribute__((__may_alias__))' for 'PULONG' does not work.
+ */
+#if 0
DPRINT("Reference from %x\n", ((PULONG)&Handle)[-1]);
+#endif
}
if (DesiredAccess && AccessMode == UserMode)