-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2014-10-14 18:22, schrieb Erich E. Hoover:
On Tue, Oct 14, 2014 at 2:32 AM, Stefan Dösinger
Combined with your change that suggests that without any flag only the NULL guid is enumerated. If so I think that's worth an explicit check.
That's correct, for once this also matches the documentation ;) That was the point of that test, what kind of check were you thinking?
Checking guid == NULL in addition to callbackCount == 1.
Is the NULL guid enumerated when DDENUM_DETACHEDSECONDARYDEVICES and/or DDENUM_NONDISPLAYDEVICES are set?
Yes, the NULL/primary device is always enumerated (unless the callback requests an early stop).
Please add a test for that as well. You don't have to check any detached or non-display devices, just check that the last GUID * is NULL with those flags as well.
Sorry, I thought that you wanted the variable names maintained based on some of the other patches I've done here - I'll fix that.
Yeah, the existing code isn't consistent, that doesn't make things easier. The best for what new/modified d3d code should look like is dlls/wined3d/cs.c.
Taking a look at that code it looks like we're "protecting" such applications from having a problem by copying the memory.
driver_desc and driver_name are static. They will be initialized only once, but yes, we wouldn't get a segfault.
I can easily add a separate patch for exploring this, but are we really interested in protecting ourselves from such an app here when we've (to my knowledge) never run into one? The primary device callback code has been in place for a long time...
I don't have a strong opinion on this, but we already have a game that modifies the strings passed by another callback function, I think that's reason enough to check the Windows behavior for this callback function as well. Don't bother too much about it though, addressing the regression is more important than satisfying my curiosity.
Please extend the test to DirectDrawEnumerateA. MSDN suggests it is equivalent to DirectDrawEnumerateExA(DDENUM_NONDISPLAYDEVICES), but I have my doubts here. Comparing the strings of the non-NULL device against "DirectDraw HAL" and "display" (in the Ex and non-Ex case) would also be a good idea.
This sounds like something that should be done separately, as we don't currently support the DDENUM_NONDISPLAYDEVICES flag.
I'm not worried too much about the DDENUM_NONDISPLAYDEVICES part. What needs to be verified is that the last GUID enumerated by DirectDrawEnumerateA is NULL like in DirectDrawEnumerateExA.
None of the testbots actually return "DirectDraw HAL"/"display", nor do my tests on a Windows 7 machine.
Ok.