typedef struct tagMULTI_QI {
  IID *pIID;
  PVOID  *pItf;
  HRESULT   hr;
} MULTI_QI;


typedef struct _COAUTHIDENTITY {
  USHORT *User;
  ULONG  UserLength;
  USHORT *Domain;
  ULONG  DomainLength;
  USHORT *Password;
  ULONG  PasswordLength;
  ULONG  Flags;
} COAUTHIDENTITY;

typedef struct _COAUTHINFO {
  DWORD          dwAuthnSvc;
  DWORD          dwAuthzSvc;
  LPWSTR         pwszServerPrincName;
  DWORD          dwAuthnLevel;
  DWORD          dwImpersonationLevel;
  COAUTHIDENTITY *pAuthIdentityData;
  DWORD          dwCapabilities;
} COAUTHINFO;

typedef struct _COSERVERINFO {
  DWORD      dwReserved1;
  LPWSTR     pwszName;
  COAUTHINFO *pAuthInfo;
  DWORD      dwReserved2;
} COSERVERINFO;


typedef struct _CALLFRAMEPARAMINFO{
  BOOLEAN fIn;
  BOOLEAN fOut;
  ULONG   stackOffset;
  ULONG   cbParam;
} CALLFRAMEPARAMINFO;

typedef struct _CALLFRAMEINFO{
  ULONG iMethod;
  BOOL  fHasInValues;
  BOOL  fHasInOutValues;
  BOOL  fHasOutValues;
  BOOL  fDerivesFromIDispatch;
  LONG  cInInterfacesMax;
  LONG  cInOutInterfacesMax;
  LONG  cOutInterfacesMax;
  LONG  cTopLevelInInterfaces;
  IID   iid;
  ULONG cMethod;
  ULONG cParams;
} CALLFRAMEINFO;


typedef struct _CALLFRAME_MARSHALCONTEXT{
  BOOLEAN  fIn;
  DWORD    dwDestContext;
  LPVOID   pvDestContext;
  PVOID *mshlmgr; // Was <IUnknown> how can I do for this circle dep ?
  GUID     guidTransferSyntax;
} CALLFRAME_MARSHALCONTEXT;


typedef enum  _CALLFRAME_COPY{
  CALLFRAME_COPY_NESTED       = 1,
  CALLFRAME_COPY_INDEPENDENT  = 2
} CALLFRAME_COPY;


typedef enum tagMSHLFLAGS {
  MSHLFLAGS_NORMAL       = 0,
  MSHLFLAGS_TABLESTRONG  = 1,
  MSHLFLAGS_TABLEWEAK    = 2,
  MSHLFLAGS_NOPING       = 4
} MSHLFLAGS;

typedef enum tagCALLFRAME_WALK {
  CALLFRAME_WALK_IN     = 1,
  CALLFRAME_WALK_INOUT  = 2,
  CALLFRAME_WALK_OUT    = 4
} CALLFRAME_WALK;

typedef struct tagSAFEARRAYBOUND
{
    ULONG cElements;
    LONG lLbound;
}   SAFEARRAYBOUND, *LPSAFEARRAYBOUND;


typedef struct tagSAFEARRAY
{
  USHORT cDims;
  USHORT fFeatures;
  ULONG cbElements;
  ULONG cLocks;
  PVOID pvData;
  SAFEARRAYBOUND rgsabound[ 1 ];
}   SAFEARRAY;

typedef struct __tagBRECORD {
    PVOID pvRecord;
    PVOID pRecInfo;
} _tagBRECORD;

union _ANON_TMP_variant_sub_union{
    LONGLONG llVal;
    LONG lVal;
    BYTE bVal;
    SHORT iVal;
    FLOAT fltVal;
    DOUBLE dblVal;
    VARIANT_BOOL boolVal;
    SCODE scode;
    BSTR bstrVal;
    PVOID punkVal;
    PVOID pdispVal;
    SAFEARRAY *parray;
    BYTE *pbVal;
    SHORT *piVal;
    LONG *plVal;
    LONGLONG *pllVal;
    FLOAT *pfltVal;
    DOUBLE *pdblVal;
    VARIANT_BOOL *pboolVal;
    SCODE *pscode;
    BSTR *pbstrVal;
    PVOID byref;
    CHAR cVal;
    USHORT uiVal;
    ULONG ulVal;
    ULONGLONG ullVal;
    INT intVal;
    UINT uintVal;
    CHAR *pcVal;
    USHORT *puiVal;
    ULONG *pulVal;
    ULONGLONG *pullVal;
    INT *pintVal;
    UINT *puintVal;
    _tagBRECORD _VARIANT_NAME_4;
};


typedef struct __tagVARIANT {
    VARTYPE vt;
    WORD wReserved1;
    WORD wReserved2;
    WORD wReserved3;
    _ANON_TMP_variant_sub_union _VARIANT_NAME_3;
} _tagVARIANT, VARIANT, VARIANTARG, *LPVARIANT, *LPVARIANTARG;


typedef enum tagCOMSD {
  SD_LAUNCHPERMISSIONS = 0,
  SD_ACCESSPERMISSIONS = 1,
  SD_LAUNCHRESTRICTIONS = 2,
  SD_ACCESSRESTRICTIONS = 3
} COMSD;