From 3a59af9f25e4675787e24421bb6ec2641dff04f3 Mon Sep 17 00:00:00 2001 From: basil00 Date: Wed, 24 Oct 2012 22:46:13 +0800 Subject: [PATCH] - Ignore ERROR_INVALID_PARAMETER from pfnWdfPostDeviceInstall() as these errors appear to be benign. --- dll/divert.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dll/divert.c b/dll/divert.c index d3ca4b5..ef7307c 100644 --- a/dll/divert.c +++ b/dll/divert.c @@ -517,6 +517,13 @@ static BOOLEAN DivertDriverInstall(VOID) // Post-install: err = pfnWdfPostDeviceInstall(divert_inf, NULL); + if (err == ERROR_INVALID_PARAMETER) + { + // We ignore ERROR_INVALID_PARAMETER. WdfPostDeviceInstall sometimes + // returns this error for no obvious reason, and when ignored the + // driver seems to still work perfectly. + err = ERROR_SUCCESS; + } if (err != ERROR_SUCCESS) { SetLastError(err);