The lpOptions
parameter is declared incorrectly. You declare it as ByVal
but it should be ByRef
.
That said, -2147467259
is a bit of an oddity. That's not a Win32 error code. That's a COM HRESULT
. Specifically it's 0x80004005
. Which is the COM wrapper around the Win32 ERROR_ACCESS_DENIED
. Not sure where you get a COM HRESULT
from in this code mind you, but it would appear that you don't have sufficient rights for what you are attempting.