A subsequent patch will add code called from SystemInitialize() that will need
to make hypercalls.
NOTE: There is a missing code to AcpiTeardown() in DllUnload() which is
also fixed by this patch.
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
__DriverSetUnplugKey(UnplugKey);
+ HypercallInitialize();
+
status = AcpiInitialize();
if (!NT_SUCCESS(status))
goto fail6;
if (!NT_SUCCESS(status))
goto fail7;
- HypercallInitialize();
-
status = BugCheckInitialize();
if (!NT_SUCCESS(status))
goto fail8;
BugCheckTeardown();
- HypercallTeardown();
-
fail8:
Error("fail8\n");
fail6:
Error("fail6\n");
+ HypercallTeardown();
+
RegistryCloseKey(UnplugKey);
__DriverSetUnplugKey(NULL);
BugCheckTeardown();
- HypercallTeardown();
-
SystemTeardown();
+ AcpiTeardown();
+
+ HypercallTeardown();
+
UnplugKey = __DriverGetUnplugKey();
RegistryCloseKey(UnplugKey);