/*
 * Plug and Play Manager RPC interface definition
 */

#include "include/reactos/idl/wtypes.idl"

#define CONFIGRET unsigned long

[
  uuid (809F4e40-A03D-11CE-8F69-08003E30051B),
  version(1.0),
  pointer_default(unique)
  #ifndef __midl
  ,explicit_handle
  #endif
]
interface pnp
{
    /* Function 0 */
//    CONFIGRET PNP_Unknown0(handle_t BindingHandle);

    /* Function 1 */
//    CONFIGRET PNP_Unknown1(handle_t BindingHandle);

    /* Function 2 */
    CONFIGRET PNP_GetVersion(handle_t BindingHandle,
                             [out] WORD *Version);

    /* Function 3 */
    CONFIGRET PNP_GetGlobalState(handle_t BindingHandle,
                                 [out] unsigned long *State,
                                 [in] unsigned long Flags);

    /* Function 4 */
    CONFIGRET PNP_InitDetection(handle_t BindingHandle);

    /* Function 5 */
    CONFIGRET PNP_ReportLogOn(handle_t BindingHandle,
                              [in] BOOL Admin,
                              [in] DWORD ProcessId);

    /* Function 6 */
    CONFIGRET PNP_ValidateDeviceInstance(handle_t BindingHandle,
                                         [in, string] wchar_t *DeviceInstance,
                                         [in] DWORD Flags);

    /* Function 7 */
    CONFIGRET PNP_GetRootDeviceInstance(handle_t BindingHandle,
                                        [out, string, size_is(Length)] wchar_t *DeviceInstance,
                                        [in] DWORD Length);

    /* Function 8 */
    cpp_quote("#define PNP_DEVICE_PARENT  1")
    cpp_quote("#define PNP_DEVICE_CHILD   2")
    cpp_quote("#define PNP_DEVICE_SIBLING 3")
    CONFIGRET PNP_GetRelatedDeviceInstance(handle_t BindingHandle,
                                           [in] DWORD Relationship,
                                           [in, string] wchar_t *DeviceId,
                                           [out, string, size_is(Length)] wchar_t *RelatedDeviceId,
                                           [in] DWORD Length,
                                           [in] DWORD Flags);

    /* Function 9 */
    cpp_quote("#define PNP_BRANCH_ENUM  1")
    cpp_quote("#define PNP_BRANCH_CLASS 2")
    CONFIGRET PNP_EnumerateSubKeys(handle_t BindingHandle,
                                   [in] unsigned long Branch,
                                   [in] unsigned long Index,
                                   [out, string, size_is(Length)] wchar_t *Buffer,
                                   [in] unsigned long Length,
                                   [out] unsigned long *RequiredLength,
                                   [in] DWORD Flags);

    /* Function 10 */
//    CONFIGRET PNP_GetDeviceList(handle_t BindingHandle,
//                                [in, unique, string] wchar_t *Filter,
//                                [out, string, size_is(*Length)] unsigned char *Buffer
//                                [in, out] unsigned long *Length,
//                                [in] DWORD Flags);

    /* Function 11 */
    CONFIGRET PNP_GetDeviceListSize(handle_t BindingHandle,
                                    [in, unique, string] wchar_t *Filter,
                                    [out] unsigned long *Length,
                                    [in] DWORD Flags);

    /* Function 12 */
    CONFIGRET PNP_GetDepth(handle_t BindingHandle,
                           [in, string] wchar_t *DeviceInstance,
                           [out] unsigned long *Depth,
                           [in] DWORD Flags);

    /* Function 13 */
    CONFIGRET PNP_GetDeviceRegProp(handle_t BindingHandle,
                                   [in, string] wchar_t *DeviceInstance,
                                   [in] unsigned long Property,
                                   [in, out] unsigned long *DataType,
                                   [out, size_is(*TransferLen)] char *Buffer,
                                   [in, out] unsigned long *TransferLen,
                                   [in, out] unsigned long *Length,
                                   [in] DWORD Flags);

    /* Function 14 */
    CONFIGRET PNP_SetDeviceRegProp(handle_t BindingHandle,
                                   [in, string] wchar_t *DeviceId,
                                   [in] unsigned long Property,
                                   [in] unsigned long DataType,
                                   [in, size_is(Length)] char *Buffer,
                                   [in] unsigned long Length,
                                   [in] unsigned long Flags);

    /* Function 15 */
    CONFIGRET PNP_GetClassInstance(handle_t BindingHandle,
                                   [in, string] wchar_t *DeviceId,
                                   [out, string, size_is(Length)] wchar_t *Buffer,
                                   [in] unsigned long Length);

    /* Function 16 */
    CONFIGRET PNP_CreateKey(handle_t BindingHandle,
                            [in, string] wchar_t *SubKey,
                            [in] unsigned long DesiredAccess,
                            [in] unsigned long Flags);

    /* Function 17 */
    CONFIGRET PNP_DeleteRegistryKey(handle_t BindingHandle,
                                    [in, string] wchar_t *DeviceId,
                                    [in, string] wchar_t *ParentKey,
                                    [in, string] wchar_t *ChildKey,
                                    [in] unsigned long Flags);

    /* Function 19 */
    CONFIGRET PNP_GetClassName(handle_t BindingHandle,
                               [in, string] wchar_t *ClassGuid,
                               [out, string, size_is(*Length)] wchar_t *Buffer,
                               [in, out] unsigned long *Length,
                               [in] unsigned long Flags);

    /* Function 20 */
    CONFIGRET PNP_DeleteClassKey(handle_t BindingHandle,
                                 [in, string] wchar_t *ClassGuid,
                                 [in] unsigned long Flags);

    /* Function 28 */
    CONFIGRET PNP_CreateDevInst(handle_t BindingHandle,
                                [in, out, string, size_is(Length)] wchar_t *DeviceId,
                                [in, string] wchar_t *ParentDeviceId,
                                [in] unsigned long Length,
                                [in] unsigned long Flags);

    /* Function 29 */
    CONFIGRET PNP_DeviceInstanceAction(handle_t BindingHandle,
                                       [in] unsigned long MajorAction,
                                       [in] unsigned long MinorAction,
                                       [in, unique, string] wchar_t *DeviceInstance1,
                                       [in, unique, string] wchar_t *DeviceInstance2);

    /* Function 30 */
    CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle,
                                  [in, string] wchar_t *DeviceInstance,
                                  [out] unsigned long *Status,
                                  [out] unsigned long *Problem,
                                  [in] DWORD Flags);

    /* Function 31 */
    CONFIGRET PNP_SetDeviceProblem(handle_t BindingHandle,
                                   [in, string] wchar_t *DeviceInstance,
                                   [in] unsigned long Problem,
                                   [in] DWORD Flags);

    /* Function 33 */
    CONFIGRET PNP_UninstallDevInst(handle_t BindingHandle,
                                   [in, string] wchar_t *DeviceInstance,
                                   [in] DWORD Flags);

    /* Function 34 */
    CONFIGRET PNP_AddID(handle_t BindingHandle,
                        [in, string, unique] wchar_t *DeviceInstance,
                        [in, string] wchar_t *DeviceId,
                        [in] DWORD Flags);

    /* Function 38 */
    CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle,
                                       [out]PBOOL Present);

    /* Function 39 */
    CONFIGRET PNP_RequestEjectPC(handle_t BindingHandle);

    /* Function 40 */
    cpp_quote("#define PNP_SET_HW_PROFILE_FLAGS  0")
    cpp_quote("#define PNP_GET_HW_PROFILE_FLAGS  1")
    CONFIGRET PNP_HwProfFlags(handle_t BindingHandle,
                              [in] DWORD Action,
                              [in, string] wchar_t *DeviceId,
                              [in] DWORD ProfileId,
                              [in, out] unsigned long *Value,
                              [in] DWORD Flags);

    /* Function 42 */
    CONFIGRET PNP_AddEmptyLogConf(handle_t BindingHandle,
                                  [in, string] wchar_t *DeviceInstance,
                                  [in] ULONG ulPriority,
                                  [out] ULONG *pulLogConfTag,
                                  [in] ULONG ulFlags);

    /* Function 43 */
    CONFIGRET PNP_FreeLogConf(handle_t BindingHandle,
                              [in, string] wchar_t *DeviceInstance,
                              [in] ULONG ulType,
                              [in] ULONG ulLogConfTag,
                              [in] ULONG ulFlags);

    /* Function 44 */
    CONFIGRET PNP_GetFirstLogConf(handle_t BindingHandle,
                                  [in, string] wchar_t *DeviceInstance,
                                  [in] ULONG ulPriority,
                                  [out] ULONG *pulLogConfTag,
                                  [in] ULONG ulFlags);

    /* Function 45 */
    CONFIGRET PNP_GetNextLogConf(handle_t BindingHandle,
                                 [in, string] wchar_t *DeviceInstance,
                                 [in] ULONG ulLogConfType,
                                 [in] ULONG ulCurrentTag,
                                 [out] ULONG *pulNextTag,
                                 [in] ULONG ulFlags);

    /* Function 46 */
    CONFIGRET PNP_GetLogConfPriority(handle_t BindingHandle,
                                     [in, string] wchar_t *DeviceInstance,
                                     [in] ULONG ulLogConfType,
                                     [in] ULONG ulCurrentTag,
                                     [out] ULONG *pPriority,
                                     [in] ULONG ulFlags);

    /* Function 58 */
    CONFIGRET PNP_RunDetection(handle_t BindingHandle,
                               [in] unsigned long Flags);
}
