Hi All,
I am calling a ExSetFirmwareEnvironmentVariable from my driver to set value of a exsisting variable. This varible is created by an application with attributes (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_SERVICE).
But call to ExSetFirmwareEnvironmentVariable is producing a BSOD with bugcheck PFN_LIST_CORRUPT (4e).
Arguments:
Arg1: 00000007, A driver has unlocked a page more times than it locked it
Arg2: 0004ac33, page frame number
Arg3: 00000001, current share count
Arg4: 00000000, 0
8eee1924 81400a85 0000004e 00000007 0004ac33 nt!KeBugCheckEx
8eee19a8 8128e8c1 8be00000 8eee1a1c 8eee19f4 nt! ?? ::FNODOBFM::string'+0x1ee4b 8eee19b8 816ed2af 8be00000 31cc09e5 00000000 nt!ExUnlockUserBuffer+0xe 8eee19f4 816580a0 8be00000 8eee1a84 00000000 nt! ?? ::NNGAKEGL::
string’+0x6176d
8eee1a20 8165829b 8a517da8 9cebcd00 8a855338 nt!ExpSetFirmwareEnvironmentVariable+0x26
8eee1a48 9cebc6a6 8eee1a78 9cebcd00 8a855338 nt!ExSetFirmwareEnvironmentVariable+0x4b
8eee1a8c 9cebc729 8a855338 00000000 896c4190 testdrv!SetParams+0xce
But if I set the same variable from another usermode application using SetFirmwareEnvironmentVariableEx it works fine.
Can anyone tell me…
-
Why ExSetFirmwareEnvironmentVariable is producing BSOD while SetFirmwareEnvironmentVariableEx is working fine?
-
Am I missing something?
I have called the function as follows…
ulAttributes = 0x00000001 | 0x00000002 | 0x00000004/*VARIABLE_ATTRIBUTE_NON_VOLATILE*/;
ulValueLength = sizeof(PARAMETER);
RtlInitUnicodeString(&VariableName, NVRAM_VARIABLE_NAME);
NtStatus = pfnExSetFirmwareEnvironmentVariable(
&VariableName,
&VariableGUID,
pParams,
&ulValueLength,
&ulAttributes
);
Thanks & Regards,
Amit.