dsound: Don't use state.buffer_size before it has been initialized.

This commit is contained in:
Francois Gouget 2006-09-29 12:45:02 +02:00 committed by Alexandre Julliard
parent dc0cfe7729
commit be87fe8c7c
2 changed files with 4 additions and 4 deletions
dlls/dsound/tests

View File

@ -562,14 +562,14 @@ void test_buffer(LPDIRECTSOUND dso, LPDIRECTSOUNDBUFFER *dsbo,
} }
/* try an offset past the end of the buffer */ /* try an offset past the end of the buffer */
rc = IDirectSoundBuffer_Lock(*dsbo, state.buffer_size, 0, &buffer1, rc = IDirectSoundBuffer_Lock(*dsbo, dsbcaps.dwBufferBytes, 0, &buffer1,
&length1, NULL, NULL, &length1, NULL, NULL,
DSBLOCK_ENTIREBUFFER); DSBLOCK_ENTIREBUFFER);
ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have " ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc)); "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
/* try a size larger than the buffer */ /* try a size larger than the buffer */
rc = IDirectSoundBuffer_Lock(*dsbo, 0, state.buffer_size + 1, rc = IDirectSoundBuffer_Lock(*dsbo, 0, dsbcaps.dwBufferBytes + 1,
&buffer1, &length1, NULL, NULL, &buffer1, &length1, NULL, NULL,
DSBLOCK_FROMWRITECURSOR); DSBLOCK_FROMWRITECURSOR);
ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have " ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "

View File

@ -448,14 +448,14 @@ void test_buffer8(LPDIRECTSOUND8 dso, LPDIRECTSOUNDBUFFER * dsbo,
} }
/* try an offset past the end of the buffer */ /* try an offset past the end of the buffer */
rc = IDirectSoundBuffer_Lock(*dsbo, state.buffer_size, 0, &buffer1, rc = IDirectSoundBuffer_Lock(*dsbo, dsbcaps.dwBufferBytes, 0, &buffer1,
&length1, NULL, NULL, &length1, NULL, NULL,
DSBLOCK_ENTIREBUFFER); DSBLOCK_ENTIREBUFFER);
ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have " ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "
"returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc)); "returned DSERR_INVALIDPARAM, returned %s\n", DXGetErrorString8(rc));
/* try a size larger than the buffer */ /* try a size larger than the buffer */
rc = IDirectSoundBuffer_Lock(*dsbo, 0, state.buffer_size + 1, rc = IDirectSoundBuffer_Lock(*dsbo, 0, dsbcaps.dwBufferBytes + 1,
&buffer1, &length1, NULL, NULL, &buffer1, &length1, NULL, NULL,
DSBLOCK_FROMWRITECURSOR); DSBLOCK_FROMWRITECURSOR);
ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have " ok(rc==DSERR_INVALIDPARAM, "IDirectSoundBuffer_Lock() should have "