[Bug 1875] New: CoCreateGuid under wine generates rather weak guid's

Wine Bugs wine-bugs at winehq.com
Tue Dec 9 21:32:55 CST 2003


http://bugs.winehq.com/show_bug.cgi?id=1875

           Summary: CoCreateGuid under wine generates rather weak guid's
           Product: Wine
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: wine-binary
        AssignedTo: wine-bugs at winehq.com
        ReportedBy: luolin at dreamwork.cn


OS: redhat linux 9.0
wine: 20031118 rpm for rh9 (i386 & i686)

the following code is a bare stream test app compiled under microsoft 2000 sp4 
visual studio .net 2003. it generates quite pleasing guid's under windows, but 
when run the compiled binary directly under wine in my linux box, the generated 
guid's are quite weak - guid.Data1 (32 bits) is a pseudo random number, and the 
rest parts guid.Data2, guid.Data3, guid.Data4 are all the same for all the 
guid's generated.

============================

#include <tchar.h>
#include <objbase.h>
#include <windows.h>

#include <iomanip>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
    for (int i = 0; i < 1000; ++i) {
        GUID guid;
        CoCreateGuid(&guid);

        std::cout << std::hex << std::setw(8) << std::setfill('0') << 
guid.Data1 << ':';

        std::cout << std::hex << std::setw(4) << std::setfill('0') << 
guid.Data2 << ':';

        std::cout << std::hex << std::setw(4) << std::setfill('0') << 
guid.Data3 << ':';

        UINT64 dnid;
        memcpy(&dnid, guid.Data4, 8);

        std::cout << std::hex << std::setw(16) << std::setfill('0') << dnid << 
std::endl;
    }

	return 0;
}

-- 
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list