PiCMHandleIoctl

NTSTATUS __stdcall PiCMHandleIoctl(
        VOID *IoctlInputBuffer,
        UINT64 IoctlInputBufferSize,
        VOID *IoctlOutputBuffer,
        UINT64 IoctlOutputBufferSize,
        UINT64 *BytesUsed,
        UINT64 IoControlCode){
  UINT64 *Is32BitProcess; 
  int v8; 

  *(_DWORD *)BytesUsed = 0;
  if( (unsigned int)IoControlCode <= 0x47083F )
  {
    if( (_DWORD)IoControlCode == 4655167 )
    {
      LODWORD(Is32BitProcess) = v8;
      return PiCMGetDeviceInterfaceAlias(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    }
    if( (unsigned int)IoControlCode > 0x47081F )
    {
      switch( (_DWORD)IoControlCode )
      {
        case 0x470823:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetRelatedDeviceInstance(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470827:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetDeviceStatus(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47082B:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetDeviceDepth(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47082F:
          return PiCMSetDeviceProblem(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470833:
          LODWORD(Is32BitProcess) = v8;
          return PiCMQueryRemove(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470837:
          LODWORD(Is32BitProcess) = v8;
          return PiCMRegisterDeviceInterface(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47083B:
          LODWORD(Is32BitProcess) = v8;
          return PiCMUnregisterDeviceInterface(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
      }
    }
    else
    {
      switch( (_DWORD)IoControlCode )
      {
        case 0x47081F:
          LODWORD(Is32BitProcess) = v8;
          return PiCMSetRegistryProperty(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470803:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetDeviceIdList(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470807:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetDeviceInterfaceList(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47080B:
          return PiCMEnumerateSubKeys(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47080F:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetObjectPropertyKeys(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470813:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetObjectProperty(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x470817:
          LODWORD(Is32BitProcess) = v8;
          return PiCMSetObjectProperty(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
        case 0x47081B:
          LODWORD(Is32BitProcess) = v8;
          return PiCMGetRegistryProperty(
                   IoctlInputBuffer,
                   IoctlInputBufferSize,
                   IoctlOutputBuffer,
                   IoctlOutputBufferSize,
                   Is32BitProcess);
      }
    }
    return -1073741637;
  }
  if( (unsigned int)IoControlCode <= 0x47085F )
  {
    switch( (_DWORD)IoControlCode )
    {
      case 0x47085F:
        LODWORD(Is32BitProcess) = v8;
        return PiCMDeleteDeviceKey(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x470843:
        LODWORD(Is32BitProcess) = v8;
        return PiCMValidateDeviceInstance(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x470847:
        LODWORD(Is32BitProcess) = v8;
        return PiCMCreateDevice(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x47084B:
        LODWORD(Is32BitProcess) = v8;
        return PiCMDeleteDevice(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x47084F:
        LODWORD(Is32BitProcess) = v8;
        return PiCMDeviceAction(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x470853:
        LODWORD(Is32BitProcess) = v8;
        return PiCMOpenDeviceInterfaceKey(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x470857:
        LODWORD(Is32BitProcess) = v8;
        return PiCMDeleteDeviceInterfaceKey(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
      case 0x47085B:
        LODWORD(Is32BitProcess) = v8;
        return PiCMOpenDeviceKey(
                 IoctlInputBuffer,
                 IoctlInputBufferSize,
                 IoctlOutputBuffer,
                 IoctlOutputBufferSize,
                 Is32BitProcess);
    }
    return -1073741637;
  }
  switch( (_DWORD)IoControlCode )
  {
    case 0x470863:
      LODWORD(Is32BitProcess) = v8;
      return PiCMOpenClassKey(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    case 0x470867:
      LODWORD(Is32BitProcess) = v8;
      return PiCMDeleteClassKey(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    case 0x47086B:
      LODWORD(Is32BitProcess) = v8;
      return PiCMOpenObjectKey(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    case 0x47086F:
      LODWORD(Is32BitProcess) = v8;
      return PiCMCreateObject(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    case 0x470873:
      LODWORD(Is32BitProcess) = v8;
      return PiCMDeleteObject(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    case 0x470877:
      LODWORD(Is32BitProcess) = v8;
      return PiCMGetObjectList(
               IoctlInputBuffer,
               IoctlInputBufferSize,
               IoctlOutputBuffer,
               IoctlOutputBufferSize,
               Is32BitProcess);
    default:
      return -1073741637;
  }
}

Referenced by:

PiCMFastIoDeviceDispatch