Re: Resend: [Bug 2631] Trap in RegisterClassExA
"Ann and Jason Edmeades" <us(a)the-edmeades.demon.co.uk> wrote:
Make RegisterClassExA check the reserved bytes is a valid value Tests to confirm this behaviour
+ /* Bug 2631 - Supplying an invalid number of bytes fails */ + cls.cbClsExtra = 0; + cls.cbWndExtra = -1; + ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)), + "Failed with invalid number of WndExtra bytes\n"); + + cls.cbClsExtra = -1; + cls.cbWndExtra = 0; + ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)), + "Failed with invalid number of ClsExtra bytes\n"); + + cls.cbClsExtra = -1; + cls.cbWndExtra = -1; + ok( ((RegisterClassA( &cls ) == 0) && (GetLastError() == ERROR_INVALID_PARAMETER)), + "Failed with invalid number of ClsExtra and cbWndExtra bytes\n");
You need to set last error to some bogus value (0xdeadbeef usually works) before every API call to ensure that it's really that API call who sets the error. -- Dmitry.
participants (1)
-
Dmitry Timoshkov