#include "config.h"
#include "captive/ps_reactos.h" /* self */
+#include "captive/macros.h"
-static captive_KPCR captive_KeGetCurrentKPCR_KPCR_static;
+/* Do not use static variable here:
+ * We would not get ElectricFence checks on accesses
+ * in original ReactOS 'KPCR'/'IKPCR' structure manner.
+ */
+static captive_KPCR *captive_KeGetCurrentKPCR_KPCR;
/**
* captive_KeGetCurrentKPCR:
captive_PKPCR captive_KeGetCurrentKPCR(void)
{
/* TODO:thread */
- return &captive_KeGetCurrentKPCR_KPCR_static;
+ if (!captive_KeGetCurrentKPCR_KPCR)
+ captive_new0(captive_KeGetCurrentKPCR_KPCR);
+ return captive_KeGetCurrentKPCR_KPCR;
}