Commit 7d5af1d8 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

mciqtz32: Simplify null parameter checks.

parent 46d59739
...@@ -213,9 +213,6 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags, ...@@ -213,9 +213,6 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
if (!lpOpenParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -439,9 +436,6 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms ...@@ -439,9 +436,6 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -499,9 +493,6 @@ static DWORD MCIQTZ_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms ...@@ -499,9 +493,6 @@ static DWORD MCIQTZ_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -594,9 +585,6 @@ static DWORD MCIQTZ_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P ...@@ -594,9 +585,6 @@ static DWORD MCIQTZ_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_P
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -693,9 +681,6 @@ static DWORD MCIQTZ_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpPar ...@@ -693,9 +681,6 @@ static DWORD MCIQTZ_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpPar
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -750,9 +735,6 @@ static DWORD MCIQTZ_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMS ...@@ -750,9 +735,6 @@ static DWORD MCIQTZ_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMS
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -853,9 +835,6 @@ static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lp ...@@ -853,9 +835,6 @@ static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lp
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -918,8 +897,6 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS ...@@ -918,8 +897,6 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
if (dwFlags & MCI_TEST) if (dwFlags & MCI_TEST)
...@@ -963,9 +940,6 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS ...@@ -963,9 +940,6 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
TRACE("%04x, %08x, %p\n", wDevID, dwFlags, lpParms); TRACE("%04x, %08x, %p\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -1027,9 +1001,6 @@ static DWORD MCIQTZ_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_P ...@@ -1027,9 +1001,6 @@ static DWORD MCIQTZ_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_P
TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms); TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
if (!lpParms)
return MCIERR_NULL_PARAMETER_BLOCK;
wma = MCIQTZ_mciGetOpenDev(wDevID); wma = MCIQTZ_mciGetOpenDev(wDevID);
if (!wma) if (!wma)
return MCIERR_INVALID_DEVICE_ID; return MCIERR_INVALID_DEVICE_ID;
...@@ -1170,20 +1141,23 @@ LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, ...@@ -1170,20 +1141,23 @@ LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
switch (wMsg) { switch (wMsg) {
case MCI_OPEN_DRIVER: case MCI_OPEN_DRIVER:
case MCI_CLOSE_DRIVER:
case MCI_PLAY: case MCI_PLAY:
case MCI_SEEK: case MCI_SEEK:
case MCI_STOP:
case MCI_PAUSE:
case MCI_GETDEVCAPS: case MCI_GETDEVCAPS:
case MCI_SET: case MCI_SET:
case MCI_STATUS: case MCI_STATUS:
case MCI_WHERE: case MCI_WHERE:
if (!dwParam2) return MCIERR_NULL_PARAMETER_BLOCK;
return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2);
case MCI_CLOSE_DRIVER:
case MCI_STOP:
case MCI_PAUSE:
return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2); return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2);
/* Digital Video specific */ /* Digital Video specific */
case MCI_SETAUDIO: case MCI_SETAUDIO:
case MCI_UPDATE: case MCI_UPDATE:
case MCI_WINDOW: case MCI_WINDOW:
if (!dwParam2) return MCIERR_NULL_PARAMETER_BLOCK;
return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2); return MCIQTZ_relayTaskMessage(dwDevID, wMsg, dwParam1, dwParam2);
case MCI_PUT: case MCI_PUT:
case MCI_RECORD: case MCI_RECORD:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment