I seem to remember that error 0xc0000022 is a permissions issue. Try to run as administrator and if that works, add a manifest resource with elevated rights.
Example manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="YourApplicationName" type="win32"/>
<description>Your application description</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
It may be enough to add this instead:
<requestedExecutionLevel level="highestAvailable" uiAccess="false"/>
The latter means that if the user is in the administrator group, requireAdministrator will be in effect.
Users that are not in the administrator group can not run the application, but will be notified that they have insufficient rights.