#include <windows.h>
int main()
{
HKEY hKey;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\HATEREG\\", 0,
KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
RegCloseKey(hKey);
DWORD ub;
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\HATEREG\\",
0,TEXT(""),REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
NULL,&hKey,&ub);
return 0;
}
🔒 Locked
Crash!
Advertisement
Original Post
This code crash the computer on windows XP:
Why?
Thanks.
I have written this code. It works on my computer (win2000)
but not on a friends computer (winXP).
but not on a friends computer (winXP).
What is it supposed to do?
-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
Nothing, just a test! Try to open a key "named "SOFTWARE\\HATEREG\\" in HKEY_LOCAL_MACHINE, then close that key and create it again.
Like I said. It''s only a example ripped from another project! What I don''t get is why this CRASH the os. Can this happen?
My friend have only executed the exe file, he have not access to the code so he can not track the error to a line.
Thanks.
My friend have only executed the exe file, he have not access to the code so he can not track the error to a line.
Thanks.
No it does not, not for me , but can things like this cause the OS to crash? That is the question.
Yes.
-~-The Cow of Darkness-~-
-~-The Cow of Darkness-~-
Yes?
quote:
Original post by Zeblar Nagrim
Yes?
Yes, it can cause the os to crash. The registry is part of the os. Messing it up is bad.
-~-The Cow of Darkness-~-
Ok, thanks.
quote:
Original post by thy MC
HEY
LET ME CLARIFY SOME THINGS FOR YOU
Writing into the registry is NO MONKEY BUSINESS
Thats ok, I didn''t want your help anyway.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement