Ok I cleaned up the code a bit, this is only to list every values in the key.
#include <cstdlib>
#include <iostream>
#include "windows.h"
#include "winnt.h"
#include "winreg.h"
using namespace std;
int main(int argc, char *argv[])
{
HKEY myKey = 0;
char szValueBuff[255] = {0};
char szValueName[255] = {0};
DWORD dwType = REG_SZ;
if(RegOpenKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", &myKey) == ERROR_SUCCESS)
{
cout << "Windows is installed!(Duh!)\n";
DWORD index = 0;
DWORD dwValueNameSize = sizeof(szValueName);
DWORD dwValueBuffSize = sizeof(szValueBuff);
while(RegEnumValue(myKey, index, szValueName, &dwValueNameSize, 0,
&dwType, (byte *)szValueBuff, &dwValueBuffSize) == ERROR_SUCCESS)
{
cout << szValueName << " : " << szValueBuff << "\n";
index++;
}
cout << "Error - ";
cout << RegEnumValue(myKey, index, szValueName, &dwValueNameSize, 0,
&dwType, (byte *)szValueBuff, &dwValueBuffSize);
cout << '\n';
RegCloseKey(myKey);
}
system("PAUSE");
return EXIT_SUCCESS;
}
This for me returns...
Windows is installed!(Duh!)
ParseAutoexec : 1
Error - 234
Press any key to continue . . .
But there are other values there that aren't being found. Also the constant resizing of the buffsizes value is pointless being that they never change through out this.