[RESENT]: Fixed winedbg example configuration

Jon Bright jon at siliconcircus.com
Fri Jul 18 03:01:32 CDT 2003

Marcus Meissner wrote:
> Please give more details on that bug.

I'll go one better.  Attached is a test case.  In Windows, RegEnumValue 
returns the keys in the order they were created in.  Wine will, of 
course, reorder them.  Shachar mentions newer versions of Explorer 
depend on Windows behaviour - I don't know about that, but I do know 
that the Tool palette in Borland C++Builder 5 appears in the wrong order 
because it depends on the keys not being reordered.

The test case runs on WinXP without error.  Since apps depend on this 
behaviour, I'm assuming it's not windows-version dependent.

Jon Bright
Lead Programmer, Silicon Circus Ltd.
-------------- next part --------------
#include <windows.h>
#include <stdio.h>
#pragma hdrstop

int fail(char *stage)
	printf("FAILED: %s\n",stage);
	return -1;

#pragma argsused
int main(int argc, char* argv[])
	HKEY software, wine, regorder;
	char name[2];
	DWORD i,nsize,type,ri,risize,disp;

		return fail("Create-Software");
	if (RegCreateKeyEx(software,"Wine",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&wine,&disp)!=ERROR_SUCCESS)
		return fail("Create-Wine");
	if (RegCreateKeyEx(wine,"TestRegOrder",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&regorder,&disp)!=ERROR_SUCCESS)
		return fail("Create-TestRegOrder");

	for (i=26; i; i--)
		if (RegSetValueEx(regorder,name,0,REG_DWORD,(BYTE*)&i,sizeof(i))!=ERROR_SUCCESS)
			return fail("SetValueEx");
	for (i=0; i<26; i++)
		nsize = 2;
		risize = sizeof(ri);
		if (RegEnumValue(regorder,i,name,&nsize,NULL,&type,(BYTE*)&ri,&risize)!=ERROR_SUCCESS)
			return fail("EnumValue");
		printf("%s = %d\n",name,ri);
		if (ri!=26-i)
			return fail("Comparison");

	if (RegCloseKey(regorder)!=ERROR_SUCCESS)
		return fail("CloseKey");

	if (RegDeleteKey(wine,"TestRegOrder")!=ERROR_SUCCESS)
		return fail("DeleteKey");

	return 0;

More information about the wine-devel mailing list