Module:    WIN32-Automation
Synopsis:  FFI for assorted types, constants, and functions.
Author:    David N. Gray
Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
              All rights reserved.
License:      See License.txt in this distribution for details.
Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND

// Use an imitation of Collage to pick up some miscellaneous pieces of the
// interface that don't need special treatment. 

// This file is automatically generated from "wtypes.h"; do not edit.

define C-subtype <BSTR> ( <C-unicode-string> ) end;
define C-pointer-type <LPBSTR> => <BSTR>;
define inline-only constant $VARIANT-TRUE               =   -1;
define inline-only constant $VARIANT-FALSE              =    0;
define inline constant <VARTYPE> = <C-unsigned-short>;
// enum VARENUM:
define inline-only constant $VT-EMPTY = 0;
define inline-only constant $VT-NULL = 1;
define inline-only constant $VT-I2 = 2;
define inline-only constant $VT-I4 = 3;
define inline-only constant $VT-R4 = 4;
define inline-only constant $VT-R8 = 5;
define inline-only constant $VT-CY = 6;
define inline-only constant $VT-DATE = 7;
define inline-only constant $VT-BSTR = 8;
define inline-only constant $VT-DISPATCH = 9;
define inline-only constant $VT-ERROR = 10;
define inline-only constant $VT-BOOL = 11;
define inline-only constant $VT-VARIANT = 12;
define inline-only constant $VT-UNKNOWN = 13;
define inline-only constant $VT-DECIMAL = 14;
define inline-only constant $VT-I1 = 16;
define inline-only constant $VT-UI1 = 17;
define inline-only constant $VT-UI2 = 18;
define inline-only constant $VT-UI4 = 19;
define inline-only constant $VT-I8 = 20;
define inline-only constant $VT-UI8 = 21;
define inline-only constant $VT-INT = 22;
define inline-only constant $VT-UINT = 23;
define inline-only constant $VT-VOID = 24;
define inline-only constant $VT-HRESULT = 25;
define inline-only constant $VT-PTR = 26;
define inline-only constant $VT-SAFEARRAY = 27;
define inline-only constant $VT-CARRAY = 28;
define inline-only constant $VT-USERDEFINED = 29;
define inline-only constant $VT-LPSTR = 30;
define inline-only constant $VT-LPWSTR = 31;
define inline-only constant $VT-RECORD = 36;
define inline-only constant $VT-FILETIME = 64;
define inline-only constant $VT-BLOB = 65;
define inline-only constant $VT-STREAM = 66;
define inline-only constant $VT-STORAGE = 67;
define inline-only constant $VT-STREAMED-OBJECT = 68;
define inline-only constant $VT-STORED-OBJECT = 69;
define inline-only constant $VT-BLOB-OBJECT = 70;
define inline-only constant $VT-CF = 71;
define inline-only constant $VT-CLSID = 72;
define inline-only constant $VT-BSTR-BLOB = #xfff;
define inline-only constant $VT-VECTOR = #x1000;
define inline-only constant $VT-ARRAY = #x2000;
define inline-only constant $VT-BYREF = #x4000;
define inline-only constant $VT-RESERVED = #x8000;
define inline-only constant $VT-ILLEGAL = #xffff;
define inline-only constant $VT-ILLEGALMASKED = #xfff;
define inline-only constant $VT-TYPEMASK = #xfff;


// This file is automatically generated from "oleauto.h"; do not edit.


// This file is automatically generated from "oaidl.h"; do not edit.


define C-struct <SAFEARRAYBOUND>
  sealed inline-only slot cElements-value :: <ULONG>;
  sealed inline-only slot lLbound-value  :: <LONG>;
  pack: 8;
  pointer-type-name: <LPSAFEARRAYBOUND>;
  c-name: "struct tagSAFEARRAYBOUND";
end C-struct <SAFEARRAYBOUND>;

define C-struct <SAFEARRAY>
  sealed inline-only slot cDims-value    :: <USHORT>;
  sealed inline-only slot fFeatures-value :: <USHORT>;
  sealed inline-only slot cbElements-value :: <ULONG>;
  sealed inline-only slot cLocks-value   :: <ULONG>;
  sealed inline-only slot pvData-value   :: <PVOID>;
  sealed inline-only array slot rgsabound-array :: <SAFEARRAYBOUND>,
	length: 1, address-getter: rgsabound-value;
  pack: 8;
  pointer-type-name: <LPSAFEARRAY>;
  c-name: "struct tagSAFEARRAY";
end C-struct <SAFEARRAY>;
define inline-only constant $FADF-AUTO                  =  #x1;
define inline-only constant $FADF-STATIC                =  #x2;
define inline-only constant $FADF-EMBEDDED              =  #x4;
define inline-only constant $FADF-FIXEDSIZE             = #x10;
define inline-only constant $FADF-RECORD                = #x20;
define inline-only constant $FADF-HAVEIID               = #x40;
define inline-only constant $FADF-HAVEVARTYPE           = #x80;
define inline-only constant $FADF-BSTR                  = #x100;
define inline-only constant $FADF-UNKNOWN               = #x200;
define inline-only constant $FADF-DISPATCH              = #x400;
define inline-only constant $FADF-VARIANT               = #x800;
define inline-only constant $FADF-RESERVED              = #xf008;
define inline constant <DISPID> = <LONG>;
define inline constant <MEMBERID> = <DISPID>;
define inline constant <HREFTYPE> = <DWORD>;
// enum TYPEKIND:
define inline-only constant $TKIND-ENUM = 0;
define inline-only constant $TKIND-RECORD = $TKIND-ENUM + 1;
define inline-only constant $TKIND-MODULE = $TKIND-RECORD + 1;
define inline-only constant $TKIND-INTERFACE = $TKIND-MODULE + 1;
define inline-only constant $TKIND-DISPATCH = $TKIND-INTERFACE + 1;
define inline-only constant $TKIND-COCLASS = $TKIND-DISPATCH + 1;
define inline-only constant $TKIND-ALIAS = $TKIND-COCLASS + 1;
define inline-only constant $TKIND-UNION = $TKIND-ALIAS + 1;
define inline-only constant $TKIND-MAX = $TKIND-UNION + 1;
define inline constant <TYPEKIND> = <C-int>;
define C-union <u%1>
  sealed inline-only slot lptdesc-value  :: <LPTYPEDESC>;
  sealed inline-only slot lpadesc-value  :: <LPARRAYDESC>;
  sealed inline-only slot hreftype-value :: <HREFTYPE>;
  pack: 8;
end;

define C-struct <TYPEDESC>
  sealed inline-only slot u-value        :: <u%1>;
  sealed inline-only slot vt-value       :: <VARTYPE>;
  pack: 8;
  pointer-type-name: <LPTYPEDESC>;
  c-name: "struct tagTYPEDESC";
end C-struct <TYPEDESC>;

define C-struct <ARRAYDESC>
  sealed inline-only slot tdescElem-value :: <TYPEDESC>;
  sealed inline-only slot cDims-value    :: <USHORT>;
  sealed inline-only array slot rgbounds-array :: <SAFEARRAYBOUND>,
	length: 1, address-getter: rgbounds-value;
  pack: 8;
  pointer-type-name: <LPARRAYDESC>;
  c-name: "struct tagARRAYDESC";
end C-struct <ARRAYDESC>;

define C-struct <PARAMDESCEX>
  sealed inline-only slot cBytes-value   :: <ULONG>;
  sealed inline-only slot varDefaultValue-value :: <VARIANTARG>;
  pack: 8;
  pointer-type-name: <LPPARAMDESCEX>;
  c-name: "struct tagPARAMDESCEX";
end C-struct <PARAMDESCEX>;

define C-struct <PARAMDESC>
  sealed inline-only slot pparamdescex-value :: <LPPARAMDESCEX>;
  sealed inline-only slot wParamFlags-value :: <USHORT>;
  pack: 8;
  pointer-type-name: <LPPARAMDESC>;
  c-name: "struct tagPARAMDESC";
end C-struct <PARAMDESC>;
define inline-only constant $PARAMFLAG-NONE             =    0;
define inline-only constant $PARAMFLAG-FIN              =  #x1;
define inline-only constant $PARAMFLAG-FOUT             =  #x2;
define inline-only constant $PARAMFLAG-FLCID            =  #x4;
define inline-only constant $PARAMFLAG-FRETVAL          =  #x8;
define inline-only constant $PARAMFLAG-FOPT             = #x10;
define inline-only constant $PARAMFLAG-FHASDEFAULT      = #x20;
define inline-only constant $PARAMFLAG-FHASCUSTDATA     = #x40;

define C-struct <IDLDESC>
  sealed inline-only slot dwReserved     :: <ULONG>;
  sealed inline-only slot wIDLFlags-value :: <USHORT>;
  pack: 8;
  pointer-type-name: <LPIDLDESC>;
  c-name: "struct tagIDLDESC";
end C-struct <IDLDESC>;
define inline-only constant $IDLFLAG-NONE               =
	$PARAMFLAG-NONE;
define inline-only constant $IDLFLAG-FIN                =
	$PARAMFLAG-FIN;
define inline-only constant $IDLFLAG-FOUT               =
	$PARAMFLAG-FOUT;
define inline-only constant $IDLFLAG-FLCID              =
	$PARAMFLAG-FLCID;
define inline-only constant $IDLFLAG-FRETVAL            =
	$PARAMFLAG-FRETVAL;
define C-union <u%2>
  sealed inline-only slot idldesc-value  :: <IDLDESC>;
  sealed inline-only slot paramdesc-value :: <PARAMDESC>;
  pack: 8;
end;

define C-struct <ELEMDESC>
  sealed inline-only slot tdesc-value    :: <TYPEDESC>;
  sealed inline-only slot u-value        :: <u%2>;
  pack: 8;
  pointer-type-name: <LPELEMDESC>;
  c-name: "struct tagELEMDESC";
end C-struct <ELEMDESC>;

define C-struct <TYPEATTR>
  sealed inline-only slot guid-value     :: <GUID>;
  sealed inline-only slot lcid-value     :: <LCID>;
  sealed inline-only slot dwReserved     :: <DWORD>;
  sealed inline-only slot memidConstructor-value :: <MEMBERID>;
  sealed inline-only slot memidDestructor-value :: <MEMBERID>;
  sealed inline-only slot lpstrSchema-value :: <LPOLESTR>;
  sealed inline-only slot cbSizeInstance-value :: <ULONG>;
  sealed inline-only slot typekind-value :: <TYPEKIND>;
  sealed inline-only slot cFuncs-value   :: <WORD>;
  sealed inline-only slot cVars-value    :: <WORD>;
  sealed inline-only slot cImplTypes-value :: <WORD>;
  sealed inline-only slot cbSizeVft-value :: <WORD>;
  sealed inline-only slot cbAlignment-value :: <WORD>;
  sealed inline-only slot wTypeFlags-value :: <WORD>;
  sealed inline-only slot wMajorVerNum-value :: <WORD>;
  sealed inline-only slot wMinorVerNum-value :: <WORD>;
  sealed inline-only slot tdescAlias-value :: <TYPEDESC>;
  sealed inline-only slot idldescType-value :: <IDLDESC>;
  pack: 8;
  pointer-type-name: <LPTYPEATTR>;
  c-name: "struct tagTYPEATTR";
end C-struct <TYPEATTR>;

define C-struct <DISPPARAMS>
  sealed inline-only slot rgvarg-value   :: <LPVARIANTARG>;
  sealed inline-only slot rgdispidNamedArgs-value :: <LPDISPID>;
  sealed inline-only slot cArgs-value    :: <UINT>;
  sealed inline-only slot cNamedArgs-value :: <UINT>;
  pack: 8;
  pointer-type-name: <LPDISPPARAMS>;
  c-name: "struct tagDISPPARAMS";
end C-struct <DISPPARAMS>;

define C-struct <EXCEPINFO>
  sealed inline-only slot wCode-value    :: <WORD>;
  sealed inline-only slot wReserved      :: <WORD>;
  sealed inline-only slot bstrSource-value :: <BSTR>;
  sealed inline-only slot bstrDescription-value :: <BSTR>;
  sealed inline-only slot bstrHelpFile-value :: <BSTR>;
  sealed inline-only slot dwHelpContext-value :: <DWORD>;
  sealed inline-only slot pvReserved     :: <PVOID>;
  slot pfnDeferredFillIn-value :: <FARPROC>;
  sealed inline-only slot scode-value    :: <C-HRESULT>;
  pack: 8;
  pointer-type-name: <LPEXCEPINFO>;
  c-name: "struct tagEXCEPINFO";
end C-struct <EXCEPINFO>;
// enum CALLCONV:
define inline-only constant $CC-FASTCALL = 0;
define inline-only constant $CC-CDECL = 1;
define inline-only constant $CC-MSCPASCAL = $CC-CDECL + 1;
define inline-only constant $CC-PASCAL = $CC-MSCPASCAL;
define inline-only constant $CC-MACPASCAL = $CC-PASCAL + 1;
define inline-only constant $CC-STDCALL = $CC-MACPASCAL + 1;
define inline-only constant $CC-FPFASTCALL = $CC-STDCALL + 1;
define inline-only constant $CC-SYSCALL = $CC-FPFASTCALL + 1;
define inline-only constant $CC-MPWCDECL = $CC-SYSCALL + 1;
define inline-only constant $CC-MPWPASCAL = $CC-MPWCDECL + 1;
define inline-only constant $CC-MAX = $CC-MPWPASCAL + 1;
define inline constant <CALLCONV> = <C-int>;
// enum FUNCKIND:
define inline-only constant $FUNC-VIRTUAL = 0;
define inline-only constant $FUNC-PUREVIRTUAL = $FUNC-VIRTUAL + 1;
define inline-only constant $FUNC-NONVIRTUAL = $FUNC-PUREVIRTUAL + 1;
define inline-only constant $FUNC-STATIC = $FUNC-NONVIRTUAL + 1;
define inline-only constant $FUNC-DISPATCH = $FUNC-STATIC + 1;
define inline constant <FUNCKIND> = <C-int>;
// enum INVOKEKIND:
define inline-only constant $INVOKE-FUNC = 1;
define inline-only constant $INVOKE-PROPERTYGET = 2;
define inline-only constant $INVOKE-PROPERTYPUT = 4;
define inline-only constant $INVOKE-PROPERTYPUTREF = 8;
define inline constant <INVOKEKIND> = <C-int>;

define C-struct <FUNCDESC>
  sealed inline-only slot memid-value    :: <MEMBERID>;
  sealed inline-only slot lprgscode-value :: <C-HRESULT*>;
  sealed inline-only slot lprgelemdescParam-value :: <LPELEMDESC>;
  sealed inline-only slot funckind-value :: <FUNCKIND>;
  sealed inline-only slot invkind-value  :: <INVOKEKIND>;
  sealed inline-only slot callconv-value :: <CALLCONV>;
  sealed inline-only slot cParams-value  :: <SHORT>;
  sealed inline-only slot cParamsOpt-value :: <SHORT>;
  sealed inline-only slot oVft-value     :: <SHORT>;
  sealed inline-only slot cScodes-value  :: <SHORT>;
  sealed inline-only slot elemdescFunc-value :: <ELEMDESC>;
  sealed inline-only slot wFuncFlags-value :: <WORD>;
  pack: 8;
  pointer-type-name: <LPFUNCDESC>;
  c-name: "struct tagFUNCDESC";
end C-struct <FUNCDESC>;
// enum VARKIND:
define inline-only constant $VAR-PERINSTANCE = 0;
define inline-only constant $VAR-STATIC = $VAR-PERINSTANCE + 1;
define inline-only constant $VAR-CONST = $VAR-STATIC + 1;
define inline-only constant $VAR-DISPATCH = $VAR-CONST + 1;
define inline constant <VARKIND> = <C-int>;
define inline-only constant $IMPLTYPEFLAG-FDEFAULT      =  #x1;
define inline-only constant $IMPLTYPEFLAG-FSOURCE       =  #x2;
define inline-only constant $IMPLTYPEFLAG-FRESTRICTED   =  #x4;
define inline-only constant $IMPLTYPEFLAG-FDEFAULTVTABLE =  #x8;
define C-union <u%3>
  sealed inline-only slot oInst-value    :: <ULONG>;
  sealed inline-only slot lpvarValue-value :: <LPVARIANT>;
  pack: 8;
end;

define C-struct <VARDESC>
  sealed inline-only slot memid-value    :: <MEMBERID>;
  sealed inline-only slot lpstrSchema-value :: <LPOLESTR>;
  sealed inline-only slot u-value        :: <u%3>;
  sealed inline-only slot elemdescVar-value :: <ELEMDESC>;
  sealed inline-only slot wVarFlags-value :: <WORD>;
  sealed inline-only slot varkind-value  :: <VARKIND>;
  pack: 8;
  pointer-type-name: <LPVARDESC>;
  c-name: "struct tagVARDESC";
end C-struct <VARDESC>;
// enum TYPEFLAGS:
define inline-only constant $TYPEFLAG-FAPPOBJECT = #x1;
define inline-only constant $TYPEFLAG-FCANCREATE = #x2;
define inline-only constant $TYPEFLAG-FLICENSED = #x4;
define inline-only constant $TYPEFLAG-FPREDECLID = #x8;
define inline-only constant $TYPEFLAG-FHIDDEN = #x10;
define inline-only constant $TYPEFLAG-FCONTROL = #x20;
define inline-only constant $TYPEFLAG-FDUAL = #x40;
define inline-only constant $TYPEFLAG-FNONEXTENSIBLE = #x80;
define inline-only constant $TYPEFLAG-FOLEAUTOMATION = #x100;
define inline-only constant $TYPEFLAG-FRESTRICTED = #x200;
define inline-only constant $TYPEFLAG-FAGGREGATABLE = #x400;
define inline-only constant $TYPEFLAG-FREPLACEABLE = #x800;
define inline-only constant $TYPEFLAG-FDISPATCHABLE = #x1000;
define inline-only constant $TYPEFLAG-FREVERSEBIND = #x2000;
define inline constant <TYPEFLAGS> = <C-int>;
// enum FUNCFLAGS:
define inline-only constant $FUNCFLAG-FRESTRICTED = #x1;
define inline-only constant $FUNCFLAG-FSOURCE = #x2;
define inline-only constant $FUNCFLAG-FBINDABLE = #x4;
define inline-only constant $FUNCFLAG-FREQUESTEDIT = #x8;
define inline-only constant $FUNCFLAG-FDISPLAYBIND = #x10;
define inline-only constant $FUNCFLAG-FDEFAULTBIND = #x20;
define inline-only constant $FUNCFLAG-FHIDDEN = #x40;
define inline-only constant $FUNCFLAG-FUSESGETLASTERROR = #x80;
define inline-only constant $FUNCFLAG-FDEFAULTCOLLELEM = #x100;
define inline-only constant $FUNCFLAG-FUIDEFAULT = #x200;
define inline-only constant $FUNCFLAG-FNONBROWSABLE = #x400;
define inline-only constant $FUNCFLAG-FREPLACEABLE = #x800;
define inline-only constant $FUNCFLAG-FIMMEDIATEBIND = #x1000;
define inline constant <FUNCFLAGS> = <C-int>;
// enum VARFLAGS:
define inline-only constant $VARFLAG-FREADONLY = #x1;
define inline-only constant $VARFLAG-FSOURCE = #x2;
define inline-only constant $VARFLAG-FBINDABLE = #x4;
define inline-only constant $VARFLAG-FREQUESTEDIT = #x8;
define inline-only constant $VARFLAG-FDISPLAYBIND = #x10;
define inline-only constant $VARFLAG-FDEFAULTBIND = #x20;
define inline-only constant $VARFLAG-FHIDDEN = #x40;
define inline-only constant $VARFLAG-FRESTRICTED = #x80;
define inline-only constant $VARFLAG-FDEFAULTCOLLELEM = #x100;
define inline-only constant $VARFLAG-FUIDEFAULT = #x200;
define inline-only constant $VARFLAG-FNONBROWSABLE = #x400;
define inline-only constant $VARFLAG-FREPLACEABLE = #x800;
define inline-only constant $VARFLAG-FIMMEDIATEBIND = #x1000;
define inline constant <VARFLAGS> = <C-int>;

define C-struct <CUSTDATAITEM>
  sealed inline-only slot guid-value     :: <GUID>;
  sealed inline-only slot varValue-value :: <VARIANTARG>;
  pack: 8;
  pointer-type-name: <LPCUSTDATAITEM>;
  c-name: "struct tagCUSTDATAITEM";
end C-struct <CUSTDATAITEM>;

define C-struct <CUSTDATA>
  sealed inline-only slot cCustData-value :: <DWORD>;
  sealed inline-only slot prgCustData-value :: <LPCUSTDATAITEM>;
  pack: 8;
  pointer-type-name: <LPCUSTDATA>;
  c-name: "struct tagCUSTDATA";
end C-struct <CUSTDATA>;
define constant <LPCREATETYPEINFO> = <Interface>;
define constant <LPCREATETYPEINFO2> = <Interface>;
define constant <LPCREATETYPELIB> = <Interface>;
define constant <LPCREATETYPELIB2> = <Interface>;
define constant <LPDISPATCH> = <Interface>;
define inline-only constant $DISPID-UNKNOWN             =   -1;
define inline-only constant $DISPID-VALUE               =    0;
define inline-only constant $DISPID-PROPERTYPUT         =   -3;
define inline-only constant $DISPID-NEWENUM             =   -4;
define inline-only constant $DISPID-EVALUATE            =   -5;
define inline-only constant $DISPID-CONSTRUCTOR         =   -6;
define inline-only constant $DISPID-DESTRUCTOR          =   -7;
define inline-only constant $DISPID-COLLECT             =   -8;
define constant <LPENUMVARIANT> = <Interface>;
define constant <LPTYPECOMP> = <Interface>;
// enum DESCKIND:
define inline-only constant $DESCKIND-NONE = 0;
define inline-only constant $DESCKIND-FUNCDESC = $DESCKIND-NONE + 1;
define inline-only constant $DESCKIND-VARDESC = $DESCKIND-FUNCDESC + 1;
define inline-only constant $DESCKIND-TYPECOMP = $DESCKIND-VARDESC + 1;
define inline-only constant $DESCKIND-IMPLICITAPPOBJ = $DESCKIND-TYPECOMP + 1;
define inline-only constant $DESCKIND-MAX = $DESCKIND-IMPLICITAPPOBJ + 1;
define inline constant <DESCKIND> = <C-int>;

define C-union <BINDPTR>
  sealed inline-only slot lpfuncdesc-value :: <LPFUNCDESC>;
  sealed inline-only slot lpvardesc-value :: <LPVARDESC>;
  sealed inline-only slot lptcomp-value  :: <Interface> /* ITypeComp */;
  pack: 8;
end C-union <BINDPTR>;
define C-pointer-type <LPBINDPTR> => <BINDPTR>;
define constant <LPTYPEINFO> = <Interface>;
define constant <LPTYPEINFO2> = <Interface>;
// enum SYSKIND:
define inline-only constant $SYS-WIN16 = 0;
define inline-only constant $SYS-WIN32 = $SYS-WIN16 + 1;
define inline-only constant $SYS-MAC = $SYS-WIN32 + 1;
define inline constant <SYSKIND> = <C-int>;
// enum LIBFLAGS:
define inline-only constant $LIBFLAG-FRESTRICTED = #x1;
define inline-only constant $LIBFLAG-FCONTROL = #x2;
define inline-only constant $LIBFLAG-FHIDDEN = #x4;
define inline-only constant $LIBFLAG-FHASDISKIMAGE = #x8;
define inline constant <LIBFLAGS> = <C-int>;
define constant <LPTYPELIB> = <Interface>;

define C-struct <TLIBATTR>
  sealed inline-only slot guid-value     :: <GUID>;
  sealed inline-only slot lcid-value     :: <LCID>;
  sealed inline-only slot syskind-value  :: <SYSKIND>;
  sealed inline-only slot wMajorVerNum-value :: <WORD>;
  sealed inline-only slot wMinorVerNum-value :: <WORD>;
  sealed inline-only slot wLibFlags-value :: <WORD>;
  pack: 8;
  pointer-type-name: <LPTLIBATTR>;
  c-name: "struct tagTLIBATTR";
end C-struct <TLIBATTR>;
define constant <LPTYPELIB2> = <Interface>;
define constant <LPTYPECHANGEEVENTS> = <Interface>;
define constant <LPERRORINFO> = <Interface>;
define constant <LPCREATEERRORINFO> = <Interface>;
define constant <LPSUPPORTERRORINFO> = <Interface>;
define constant <LPRECORDINFO> = <Interface>;

define sealed domain make (singleton(<LPSAFEARRAYBOUND>));
define sealed domain initialize (<LPSAFEARRAYBOUND>);
define sealed domain make (singleton(<LPSAFEARRAY>));
define sealed domain initialize (<LPSAFEARRAY>);
define sealed domain make (singleton(<LPTYPEDESC>));
define sealed domain initialize (<LPTYPEDESC>);
define sealed domain make (singleton(<LPARRAYDESC>));
define sealed domain initialize (<LPARRAYDESC>);
define sealed domain make (singleton(<LPPARAMDESCEX>));
define sealed domain initialize (<LPPARAMDESCEX>);
define sealed domain make (singleton(<LPPARAMDESC>));
define sealed domain initialize (<LPPARAMDESC>);
define sealed domain make (singleton(<LPIDLDESC>));
define sealed domain initialize (<LPIDLDESC>);
define sealed domain make (singleton(<LPELEMDESC>));
define sealed domain initialize (<LPELEMDESC>);
define sealed domain make (singleton(<LPTYPEATTR>));
define sealed domain initialize (<LPTYPEATTR>);
define sealed domain make (singleton(<LPDISPPARAMS>));
define sealed domain initialize (<LPDISPPARAMS>);
define sealed domain make (singleton(<LPEXCEPINFO>));
define sealed domain initialize (<LPEXCEPINFO>);
define sealed domain make (singleton(<LPFUNCDESC>));
define sealed domain initialize (<LPFUNCDESC>);
define sealed domain make (singleton(<LPVARDESC>));
define sealed domain initialize (<LPVARDESC>);
define sealed domain make (singleton(<LPCUSTDATAITEM>));
define sealed domain initialize (<LPCUSTDATAITEM>);
define sealed domain make (singleton(<LPCUSTDATA>));
define sealed domain initialize (<LPCUSTDATA>);
define sealed domain make (singleton(<LPTLIBATTR>));
define sealed domain initialize (<LPTLIBATTR>);

// --- end of data from "oaidl.h" ---


define C-function SysAllocString
  parameter unicodestring1 ::  /* const */ <C-unicode-string>;
  result value :: <BSTR>;
  c-name: "SysAllocString", c-modifiers: "__stdcall";
end;

define C-function SysReAllocString
  parameter lpbstr1    :: <LPBSTR>;
  parameter unicodestring2 ::  /* const */ <C-unicode-string>;
  result value :: <INT>;
  c-name: "SysReAllocString", c-modifiers: "__stdcall";
end;

define C-function SysAllocStringLen
  parameter unicodestring1 ::  /* const */ <C-unicode-string>;
  parameter uint2      :: <UINT>;
  result value :: <BSTR>;
  c-name: "SysAllocStringLen", c-modifiers: "__stdcall";
end;

define C-function SysReAllocStringLen
  parameter lpbstr1    :: <LPBSTR>;
  parameter unicodestring2 ::  /* const */ <C-unicode-string>;
  parameter uint3      :: <UINT>;
  result value :: <INT>;
  c-name: "SysReAllocStringLen", c-modifiers: "__stdcall";
end;

define C-function SysFreeString
  parameter bstr1      :: <BSTR>;
  c-name: "SysFreeString", c-modifiers: "__stdcall";
end;

define C-function SysStringLen
  parameter bstr1      :: <BSTR>;
  result value :: <UINT>;
  c-name: "SysStringLen", c-modifiers: "__stdcall";
end;

define C-function SysStringByteLen
  parameter bstr       :: <BSTR>;
  result value :: <UINT>;
  c-name: "SysStringByteLen", c-modifiers: "__stdcall";
end;

define C-function SysAllocStringByteLen
  parameter psz        :: <LPCSTR>;
  parameter len        :: <UINT>;
  result value :: <BSTR>;
  c-name: "SysAllocStringByteLen", c-modifiers: "__stdcall";
end;

define C-function DosDateTimeToVariantTime
  parameter wDosDate   :: <USHORT>;
  parameter wDosTime   :: <USHORT>;
  output parameter pvtime :: <C-double*>;
  result value :: <INT>;
  c-name: "DosDateTimeToVariantTime", c-modifiers: "__stdcall";
end;

define C-function VariantTimeToDosDateTime
  parameter vtime      :: <C-double>;
  output parameter pwDosDate :: <LPUSHORT>;
  output parameter pwDosTime :: <LPUSHORT>;
  result value :: <INT>;
  c-name: "VariantTimeToDosDateTime", c-modifiers: "__stdcall";
end;

define C-function SafeArrayAllocDescriptor
  parameter cDims      :: <UINT>;
  output parameter ppsaOut :: <SAFEARRAY**>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayAllocDescriptor", c-modifiers: "__stdcall";
end;

define C-function SafeArrayAllocData
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayAllocData", c-modifiers: "__stdcall";
end;

define C-function SafeArrayCreate
  parameter vt         :: <VARTYPE>;
  parameter cDims      :: <UINT>;
  parameter rgsabound  :: <LPSAFEARRAYBOUND>;
  result value :: <LPSAFEARRAY>;
  c-name: "SafeArrayCreate", c-modifiers: "__stdcall";
end;

define C-function SafeArrayDestroyDescriptor
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayDestroyDescriptor", c-modifiers: "__stdcall";
end;

define C-function SafeArrayDestroyData
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayDestroyData", c-modifiers: "__stdcall";
end;

define C-function SafeArrayDestroy
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayDestroy", c-modifiers: "__stdcall";
end;

define C-function SafeArrayRedim
  parameter psa        :: <LPSAFEARRAY>;
  parameter psaboundNew :: <LPSAFEARRAYBOUND>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayRedim", c-modifiers: "__stdcall";
end;

define C-function SafeArrayGetDim
  parameter psa        :: <LPSAFEARRAY>;
  result value :: <UINT>;
  c-name: "SafeArrayGetDim", c-modifiers: "__stdcall";
end;

define C-function SafeArrayGetElemsize
  parameter psa        :: <LPSAFEARRAY>;
  result value :: <UINT>;
  c-name: "SafeArrayGetElemsize", c-modifiers: "__stdcall";
end;

define C-function SafeArrayGetUBound
  parameter psa        :: <LPSAFEARRAY>;
  parameter nDim       :: <UINT>;
  output parameter plUbound :: <LPLONG>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayGetUBound", c-modifiers: "__stdcall";
end;

define C-function SafeArrayGetLBound
  parameter psa        :: <LPSAFEARRAY>;
  parameter nDim       :: <UINT>;
  output parameter plLbound :: <LPLONG>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayGetLBound", c-modifiers: "__stdcall";
end;

define C-function SafeArrayLock
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayLock", c-modifiers: "__stdcall";
end;

define C-function SafeArrayUnlock
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayUnlock", c-modifiers: "__stdcall";
end;

define C-function SafeArrayAccessData
  parameter psa        :: <LPSAFEARRAY>;
  parameter ppvData    :: <C-void**>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayAccessData", c-modifiers: "__stdcall";
end;

define C-function SafeArrayUnaccessData
  parameter psa        :: <LPSAFEARRAY>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayUnaccessData", c-modifiers: "__stdcall";
end;

define C-function SafeArrayGetElement
  parameter psa        :: <LPSAFEARRAY>;
  parameter rgIndices  :: <LPLONG>;
  parameter pv         :: <C-void*>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayGetElement", c-modifiers: "__stdcall";
end;

define C-function SafeArrayPutElement
  parameter psa        :: <LPSAFEARRAY>;
  parameter rgIndices  :: <LPLONG>;
  parameter pv         :: <C-void*>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayPutElement", c-modifiers: "__stdcall";
end;

define C-function SafeArrayCopy
  parameter psa        :: <LPSAFEARRAY>;
  output parameter ppsaOut :: <SAFEARRAY**>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayCopy", c-modifiers: "__stdcall";
end;

define C-function SafeArrayPtrOfIndex
  parameter psa        :: <LPSAFEARRAY>;
  parameter rgIndices  :: <LPLONG>;
  parameter ppvData    :: <C-void**>;
  result status :: <C-HRESULT>;
  c-name: "SafeArrayPtrOfIndex", c-modifiers: "__stdcall";
end;

define C-function VariantInit
  parameter pvarg      :: <LPVARIANTARG>;
  c-name: "VariantInit", c-modifiers: "__stdcall";
end;

define C-function VariantClear
  parameter pvarg      :: <LPVARIANTARG>;
  result status :: <C-HRESULT>;
  c-name: "VariantClear", c-modifiers: "__stdcall";
end;

define C-function VariantCopy
  parameter pvargDest  :: <LPVARIANTARG>;
  parameter pvargSrc   :: <LPVARIANTARG>;
  result status :: <C-HRESULT>;
  c-name: "VariantCopy", c-modifiers: "__stdcall";
end;

define C-function VariantCopyInd
  parameter pvarDest   :: <LPVARIANT>;
  parameter pvargSrc   :: <LPVARIANTARG>;
  result status :: <C-HRESULT>;
  c-name: "VariantCopyInd", c-modifiers: "__stdcall";
end;

define C-function VariantChangeType
  parameter pvargDest  :: <LPVARIANTARG>;
  parameter pvarSrc    :: <LPVARIANTARG>;
  parameter wFlags     :: <USHORT>;
  parameter vt         :: <VARTYPE>;
  result status :: <C-HRESULT>;
  c-name: "VariantChangeType", c-modifiers: "__stdcall";
end;

define C-function VariantChangeTypeEx
  parameter pvargDest  :: <LPVARIANTARG>;
  parameter pvarSrc    :: <LPVARIANTARG>;
  parameter lcid       :: <LCID>;
  parameter wFlags     :: <USHORT>;
  parameter vt         :: <VARTYPE>;
  result status :: <C-HRESULT>;
  c-name: "VariantChangeTypeEx", c-modifiers: "__stdcall";
end;
define inline-only constant $VARIANT-NOVALUEPROP        =  #x1;
define inline-only constant $DISPATCH-METHOD            =  #x1;
define inline-only constant $DISPATCH-PROPERTYGET       =  #x2;
define inline-only constant $DISPATCH-PROPERTYPUT       =  #x4;
define inline-only constant $DISPATCH-PROPERTYPUTREF    =  #x8;

define C-function LHashValOfNameSysA
  parameter syskind    :: <SYSKIND>;
  parameter lcid       :: <LCID>;
  parameter szName     :: <LPCSTR>;
  result value :: <ULONG>;
  c-name: "LHashValOfNameSysA", c-modifiers: "__stdcall";
end;

define C-function LHashValOfNameSys
  parameter syskind    :: <SYSKIND>;
  parameter lcid       :: <LCID>;
  parameter szName     ::  /* const */ <C-unicode-string>;
  result value :: <ULONG>;
  c-name: "LHashValOfNameSys", c-modifiers: "__stdcall";
end;

define C-function LoadTypeLib
  parameter szFile     ::  /* const */ <C-unicode-string>;
  output parameter pptlib :: <Interface*> /* ITypeLib */;
  result status :: <C-HRESULT>;
  c-name: "LoadTypeLib", c-modifiers: "__stdcall";
end;

define C-function LoadRegTypeLib
  parameter rguid      :: <REFGUID>;
  parameter wVerMajor  :: <WORD>;
  parameter wVerMinor  :: <WORD>;
  parameter lcid       :: <LCID>;
  output parameter pptlib :: <Interface*> /* ITypeLib */;
  result status :: <C-HRESULT>;
  c-name: "LoadRegTypeLib", c-modifiers: "__stdcall";
end;

define C-function QueryPathOfRegTypeLib
  parameter guid       :: <REFGUID>;
  parameter wMaj       :: <USHORT>;
  parameter wMin       :: <USHORT>;
  parameter lcid       :: <LCID>;
  parameter lpbstrPathName :: <LPBSTR>;
  result status :: <C-HRESULT>;
  c-name: "QueryPathOfRegTypeLib", c-modifiers: "__stdcall";
end;

define C-function RegisterTypeLib
  parameter ptlib      :: <Interface> /* ITypeLib */;
  parameter szFullPath :: <C-unicode-string>;
  parameter szHelpDir  :: <C-unicode-string>;
  result status :: <C-HRESULT>;
  c-name: "RegisterTypeLib", c-modifiers: "__stdcall";
end;

define C-function CreateTypeLib
  parameter syskind    :: <SYSKIND>;
  parameter szFile     ::  /* const */ <C-unicode-string>;
  output parameter ppctlib :: <Interface*> /* ICreateTypeLib */;
  result status :: <C-HRESULT>;
  c-name: "CreateTypeLib", c-modifiers: "__stdcall";
end;

define C-function DispGetParam
  parameter pdispparams :: <LPDISPPARAMS>;
  parameter position   :: <UINT>;
  parameter vtTarg     :: <VARTYPE>;
  parameter pvarResult :: <LPVARIANT>;
  output parameter puArgErr :: <LPUINT>;
  result status :: <C-HRESULT>;
  c-name: "DispGetParam", c-modifiers: "__stdcall";
end;

define C-function DispGetIDsOfNames
  parameter ptinfo     :: <Interface> /* ITypeInfo */;
  parameter rgszNames  :: <C-unicode-string*>;
  parameter cNames     :: <UINT>;
  parameter rgdispid   :: <LPDISPID>;
  result status :: <C-HRESULT>;
  c-name: "DispGetIDsOfNames", c-modifiers: "__stdcall";
end;

define C-function DispInvoke
  parameter _this      :: <C-void*>;
  parameter ptinfo     :: <Interface> /* ITypeInfo */;
  parameter dispidMember :: <DISPID>;
  parameter wFlags     :: <WORD>;
  parameter pparams    :: <LPDISPPARAMS>;
  parameter pvarResult :: <LPVARIANT>;
  parameter pexcepinfo :: <LPEXCEPINFO>;
  output parameter puArgErr :: <LPUINT>;
  result status :: <C-HRESULT>;
  c-name: "DispInvoke", c-modifiers: "__stdcall";
end;

define C-function CreateStdDispatch
  parameter punkOuter  :: <Interface> /* IUnknown */;
  parameter pvThis     :: <C-void*>;
  parameter ptinfo     :: <Interface> /* ITypeInfo */;
  output parameter ppunkStdDisp :: <Interface*> /* IUnknown */;
  result status :: <C-HRESULT>;
  c-name: "CreateStdDispatch", c-modifiers: "__stdcall";
end;

define C-function RegisterActiveObject
  parameter punk       :: <Interface> /* IUnknown */;
  parameter rclsid     :: <REFCLSID>;
  parameter dwFlags    :: <DWORD>;
  output parameter pdwRegister :: <LPDWORD>;
  result status :: <C-HRESULT>;
  c-name: "RegisterActiveObject", c-modifiers: "__stdcall";
end;

define C-function RevokeActiveObject
  parameter dwRegister :: <DWORD>;
  parameter pvReserved :: <C-void*>;
  result status :: <C-HRESULT>;
  c-name: "RevokeActiveObject", c-modifiers: "__stdcall";
end;

define C-function GetActiveObject
  parameter rclsid     :: <REFCLSID>;
  parameter pvReserved :: <C-void*>;
  output parameter ppunk :: <Interface*> /* IUnknown */;
  result status :: <C-HRESULT>;
  c-name: "GetActiveObject", c-modifiers: "__stdcall";
end;

define C-function SetErrorInfo
  parameter dwReserved :: <ULONG>;
  parameter perrinfo   :: <Interface> /* IErrorInfo */;
  result status :: <C-HRESULT>;
  c-name: "SetErrorInfo", c-modifiers: "__stdcall";
end;

define C-function GetErrorInfo
  parameter dwReserved :: <ULONG>;
  output parameter pperrinfo :: <Interface*> /* IErrorInfo */;
  result status :: <C-HRESULT>;
  c-name: "GetErrorInfo", c-modifiers: "__stdcall";
end;

define C-function CreateErrorInfo
  output parameter pperrinfo :: <Interface*> /* ICreateErrorInfo */;
  result status :: <C-HRESULT>;
  c-name: "CreateErrorInfo", c-modifiers: "__stdcall";
end;

define inline-only constant $VT-HARDTYPE = $VT-RESERVED;
define inline-only constant $MEMBERID-NIL = $DISPID-UNKNOWN;

 
