See the MSDN docs for the LoadIFilter
function - you should be getting one of the error codes, at least according to that page.
- E_ACCESSDENIED =
0x80070005
-
The function was denied access to the filter file.
- E_HANDLE =
0x80070006
-
The function encountered an invalid handle, probably due to a low-memory situation.
- E_INVALIDARG =
0x80070057
-
The function received an invalid parameter.
- E_OUTOFMEMORY =
0x8007000E
-
The function did not have sufficient memory or other resources to complete the operation.
- E_FAIL =
0x80000008
-
The function encountered an unknown error.
(Also, the full set of constant values is listed here, which seems to be rather longer than that listed on MSDN.) Now, the interesting things is, your error code corresponds to 80004005
in hex, which isn't listed on either or those pages. I'm suspecting pinvoke.net may have it wrong however, as many other sites (this for example) list it as E_FAIL
... not that it really helps anyway. Sorry for the inconclusive answer, but maybe it will point you along the right track at least.
Edit: This error seems to have been documented elsewhere and caused much confusion to many people, with no simple solution. It seems like the cause could be one of several in fact... There's various suggestions here and here that you may want to try, but I don't think I can help you any more than that, as I have never encountered this error myself in this context. Good luck anyway...