/*
* Copyright 2026 Alistair Leslie-Hughes
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

import "unknwn.idl";
import "objidl.idl";
import "oaidl.idl";

typedef [v1_enum] enum
{
    UIT_INVALID,
    UIT_NONE,
    UIT_SHELL_COMMAND,
    UIT_HELP_PANE,
    UIT_DUI
} UI_INFO_TYPE;

typedef [v1_enum] enum tagREPAIR_SCOPE
{
    RS_SYSTEM,
    RS_USER,
    RS_APPLICATION,
    RS_PROCESS
} REPAIR_SCOPE;

cpp_quote("#define PREPAIR_SCOPE  *REPAIR_SCOPE")

typedef [v1_enum] enum
{
    RR_NOROLLBACK,
    RR_ROLLBACK,
    RR_NORISK
} REPAIR_RISK;

typedef struct tagShellCommandInfo
{
    [string] LPWSTR pwszOperation;
    [string] LPWSTR pwszFile;
    [string] LPWSTR pwszParameters;
    [string] LPWSTR pwszDirectory;
    ULONG nShowCmd;
} ShellCommandInfo, *PShellCommandInfo;

typedef struct tagUiInfo
{
    UI_INFO_TYPE type;
    [switch_type(UI_INFO_TYPE), switch_is(type) ] union
    {
        [ case(UIT_NONE) ]          LPWSTR pwzNull;
        [ case(UIT_SHELL_COMMAND) ] ShellCommandInfo ShellInfo;
        [ case(UIT_HELP_PANE) ]     LPWSTR pwzHelpUrl;
        [ case(UIT_DUI) ]           LPWSTR pwzDui;
    };
} UiInfo, *PUiInfo;

typedef struct tagRepairInfo
{
    GUID guid;
    [string] LPWSTR pwszClassName;
    [string] LPWSTR pwszDescription;
    DWORD sidType;
    long cost;
    ULONG flags;
    REPAIR_SCOPE scope;
    REPAIR_RISK risk;
    UiInfo UiInfo;
    int rootCauseIndex;
} RepairInfo, *PRepairInfo;

typedef struct tagRepairInfoEx
{
    RepairInfo repair;
    USHORT repairRank;
} RepairInfoEx, *PRepairInfoEx;

typedef struct tagRootCauseInfo
{
    [string] LPWSTR pwszDescription;
    GUID rootCauseID;
    DWORD rootCauseFlags;
    GUID networkInterfaceID;
    [size_is(repairCount)] RepairInfoEx *pRepairs;
    USHORT repairCount;
} RootCauseInfo, *PRootCauseInfo;
