August 22, 2012
If I try to modify a registry value with 'key.setValue()', I get an error 5, which I think is ERROR_ACCESS_DENIED. Even if I right click my .exe and choose 'run as Administrator'. I am on Windows 7 x64, and dmd 2.060. From my research, I think I have to modify my privilege tokens:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa387705%28v=vs.85%29.aspx

But this example calls methods in advapi that I can't find any bindings for in the D source, namely:
    OpenProcessToken
    LookupPrivilegeValueW
    AdjustTokenPrivileges

Any ideas?
August 22, 2012
On Wednesday, 22 August 2012 at 14:52:00 UTC, Kai Meyer wrote:
> If I try to modify a registry value with 'key.setValue()', I get an error 5, which I think is ERROR_ACCESS_DENIED. Even if I right click my .exe and choose 'run as Administrator'. I am on Windows 7 x64, and dmd 2.060. From my research, I think I have to modify my privilege tokens:
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa387705%28v=vs.85%29.aspx
>
> But this example calls methods in advapi that I can't find any bindings for in the D source, namely:
>     OpenProcessToken
>     LookupPrivilegeValueW
>     AdjustTokenPrivileges
>
> Any ideas?

Doh, I just found it. REGSAM.KEY_ALL_ACCESS......
Top | Discussion index | About this forum | D home