Probléme RegOpenKeyEx & RegEnumKeyEx
Bonjour à tous,
Comme l'indique le titre, j'ai un problème avec ces deux fonctions.
Voici mon code en C++ sous Visual Studio 2010 express :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#define ruche HKEY_LOCAL_MACHINE
#define sscle "SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Minimal"
HKEY resulat;
int index=0;
char nom[256];
DWORD t = 256;
if(RegOpenKeyEx(ruche,sscle,0, KEY_ENUMERATE_SUB_KEYS,&resulat)==ERROR_SUCCESS)
{
printf("\n\nOpen\n");
while(RegEnumKeyEx(resulat,index,nom,&t,NULL,NULL,NULL,NULL)==ERROR_SUCCESS)
{
printf("%d : %s\n",index,nom);
index++;
}
} |
Ce code ne m'affiche qu'une ligne, pour index=0. Or la clé indiqué contient bien plus de sous clés.
Je suis sous Windows 7 64bits.
En espérant que vous pourrez m'aider. :ccool: ;)
Simon.