mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:06:52 +00:00
Add parameter checks.
svn path=/trunk/; revision=16685
This commit is contained in:
parent
c5a9d200e8
commit
446d367792
1 changed files with 42 additions and 0 deletions
|
@ -341,6 +341,15 @@ CONFIGRET WINAPI CM_Get_Depth_Ex(
|
|||
TRACE("%p %lx %lx %lx\n",
|
||||
pulDepth, dnDevInst, ulFlags, hMachine);
|
||||
|
||||
if (pulDepth == NULL)
|
||||
return CR_INVALID_POINTER;
|
||||
|
||||
if (dnDevInst == 0)
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
if (ulFlags != 0)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (hMachine != NULL)
|
||||
{
|
||||
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
|
||||
|
@ -418,6 +427,15 @@ CONFIGRET WINAPI CM_Get_Device_ID_ExW(
|
|||
TRACE("%lx %p %ld %ld %lx\n",
|
||||
dnDevInst, Buffer, BufferLen, ulFlags, hMachine);
|
||||
|
||||
if (dnDevInst == 0)
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
if (Buffer == NULL)
|
||||
return CR_INVALID_POINTER;
|
||||
|
||||
if (ulFlags != 0)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (hMachine != NULL)
|
||||
{
|
||||
StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
|
||||
|
@ -560,6 +578,15 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex(
|
|||
|
||||
TRACE("%p %lx %lx %lx\n", pulLen, dnDevInst, ulFlags, hMachine);
|
||||
|
||||
if (pulLen == NULL)
|
||||
return CR_INVALID_POINTER;
|
||||
|
||||
if (dnDevInst == 0)
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
if (ulFlags != 0)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (hMachine != NULL)
|
||||
{
|
||||
StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
|
||||
|
@ -614,6 +641,15 @@ CM_Get_DevNode_Status_Ex(
|
|||
TRACE("%p %p %lx %lx %lx\n",
|
||||
pulStatus, pulProblemNumber, dnDevInst, ulFlags, hMachine);
|
||||
|
||||
if (pulStatus == NULL || pulProblemNumber == NULL)
|
||||
return CR_INVALID_POINTER;
|
||||
|
||||
if (dnDevInst == 0)
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
if (ulFlags != 0)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (hMachine != NULL)
|
||||
{
|
||||
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
|
||||
|
@ -949,6 +985,12 @@ CONFIGRET WINAPI CM_Locate_DevNode_ExW(
|
|||
|
||||
TRACE("%p %s %lu %lx\n", pdnDevInst, debugstr_w(pDeviceID), ulFlags, hMachine);
|
||||
|
||||
if (pdnDevInst == NULL)
|
||||
return CR_INVALID_POINTER;
|
||||
|
||||
if (ulFlags & ~CM_LOCATE_DEVNODE_BITS)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (hMachine != NULL)
|
||||
{
|
||||
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue