does s.o has an example, how to pass a REG_QWORD to the RegSetValueEx function?
For REG_DWORD sokmething like this works:
RegSetValueEx(
hKey,
lpValueName,
NULL,
REG_DWORD,
0x0000,
nSize
);
I tried
RegSetValueEx(
hKey,
lpValueName,
NULL,
REG_QWORD,
0x00000000,
nSize
);
but the resulting registry entry is not correct.
if I pass 0x0000000000000000 my application crashes with an exception error :(
thx & regards
hagen
This is wrong. The next to last parameter should be a pointer to a DWORD
variable holding the value, not the value itself. As in
DWORD value = 0;
RegSetValueEx(hKey, lpValueName, NULL,
REG_DWORD, (BYTE*)&value, sizeof(value));
REG_QWORD works the same way, only you pass a pointer to ULONGLONG as
the data.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Thanx for the ULONGLONG tip. It's working.
Hagen
hi again,
I was to early happy:
passing a pointer to ULONGLONG yields a result like (see value for ExecTime):
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\0\0]
"Script"="c:\\winnt\\perl\\bin\\perl.exe"
"Parameters"="c:\\winnt\\scripts\\foo.pl"
"ExecTime"=hex(b):00,00,00,00
But what I try to get is an entry like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\0\0]
"Script"="c:\\winnt\\perl\\bin\\perl.exe"
"Parameters"="c:\\winnt\\scripts\\foo.pl"
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
Further ideas?
Hagen
I've just tried it - works for me as expected. Make sure you pass the
correct data size in the last parameter.
I saw it doesn't matter: my startup script are working even the value
for ExecTime differs a bit from the value which occurs if the local
policy mmc snapin was used.
That's a heck of a lot more than a quadword. You will need to use
REG_BINARY and specify a buffer that it 16 bytes long.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc