⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wtypes.idl

📁 本源码是vc环境下的usb程序
💻 IDL
📖 第 1 页 / 共 3 页
字号:

cpp_quote("#endif //0")

cpp_quote("#ifndef _TEXTMETRIC_DEFINED")
cpp_quote("#define _TEXTMETRIC_DEFINED")
typedef struct tagTEXTMETRICW {
    LONG  tmHeight;
    LONG  tmAscent;
    LONG  tmDescent;
    LONG  tmInternalLeading;
    LONG  tmExternalLeading;
    LONG  tmAveCharWidth;
    LONG  tmMaxCharWidth;
    LONG  tmWeight;
    LONG  tmOverhang;
    LONG  tmDigitizedAspectX;
    LONG  tmDigitizedAspectY;
    WCHAR tmFirstChar;
    WCHAR tmLastChar;
    WCHAR tmDefaultChar;
    WCHAR tmBreakChar;
    BYTE  tmItalic;
    BYTE  tmUnderlined;
    BYTE  tmStruckOut;
    BYTE  tmPitchAndFamily;
    BYTE  tmCharSet;
} TEXTMETRICW, *PTEXTMETRICW, *LPTEXTMETRICW;
cpp_quote("#endif // !_TEXTMETRIC_DEFINED")


cpp_quote("#ifndef _WIN32           // The following code is for Win16 only")
cpp_quote("#ifndef WINAPI          // If not included with 3.1 headers...")

// Message structure

typedef struct tagMSG {
    HWND        hwnd;
    UINT        message;
    WPARAM      wParam;
    LPARAM      lParam;
    DWORD       time;
    POINT       pt;
} MSG, *PMSG, *NPMSG, *LPMSG;
cpp_quote("#endif // _WIN32")
cpp_quote("#endif // WINAPI")

typedef [unique] userHBITMAP      * wireHBITMAP;
typedef [unique] userHPALETTE     * wireHPALETTE;
typedef [unique] userHENHMETAFILE * wireHENHMETAFILE;
typedef [unique] userHMETAFILE    * wireHMETAFILE;
typedef [unique] userHMETAFILEPICT* wireHMETAFILEPICT;

cpp_quote("#if 0")
DECLARE_WIREM_HANDLE( HGLOBAL );
typedef HGLOBAL HLOCAL;
DECLARE_WIREM_HANDLE( HBITMAP );
DECLARE_WIREM_HANDLE( HPALETTE );
DECLARE_WIREM_HANDLE( HENHMETAFILE );
DECLARE_WIREM_HANDLE( HMETAFILE );
cpp_quote("#endif //0")

DECLARE_WIREM_HANDLE( HMETAFILEPICT );

}

// #########################################################################
//

cpp_quote("#if ( _MSC_VER >= 800 )")
cpp_quote("#if _MSC_VER >= 1200")
cpp_quote("#pragma warning(push)")
cpp_quote("#endif")
cpp_quote("#pragma warning(disable:4201)")
cpp_quote("#endif")

typedef double DATE;

/* This is a helper struct for use in handling currency. */
cpp_quote("#ifndef _tagCY_DEFINED")
cpp_quote("#define _tagCY_DEFINED")
cpp_quote("#define _CY_DEFINED")

cpp_quote("#if 0")

cpp_quote("/* the following isn't the real definition of CY, but it is */")
cpp_quote("/* what RPC knows how to remote */")
typedef struct tagCY {
    LONGLONG    int64;
} CY;

cpp_quote("#else /* 0 */")

cpp_quote("/* real definition that makes the C++ compiler happy */")
cpp_quote("typedef union tagCY {")
cpp_quote("    struct {")
cpp_quote("#ifdef _MAC")
cpp_quote("        long      Hi;")
cpp_quote("        long Lo;")
cpp_quote("#else")
cpp_quote("        unsigned long Lo;")
cpp_quote("        long      Hi;")
cpp_quote("#endif")
cpp_quote("    };")
cpp_quote("    LONGLONG int64;")
cpp_quote("} CY;")

cpp_quote("#endif /* 0 */")

cpp_quote("#endif /* _tagCY_DEFINED */")

typedef CY *LPCY;

cpp_quote("#if 0 /* _tagDEC_DEFINED */")
cpp_quote("/* The following isn't the real definition of Decimal type, */")
cpp_quote("/* but it is what RPC knows how to remote */")

typedef struct tagDEC {
    USHORT wReserved;
    BYTE  scale;
    BYTE  sign;
    ULONG Hi32;
    ULONGLONG Lo64;
} DECIMAL;

cpp_quote("#else /* _tagDEC_DEFINED */")

cpp_quote("/* real definition that makes the C++ compiler happy */")
cpp_quote("typedef struct tagDEC {")
cpp_quote("    USHORT wReserved;")
cpp_quote("    union {")
cpp_quote("        struct {")
cpp_quote("            BYTE scale;")
cpp_quote("            BYTE sign;")
cpp_quote("        };")
cpp_quote("        USHORT signscale;")
cpp_quote("    };")
cpp_quote("    ULONG Hi32;")
cpp_quote("    union {")
cpp_quote("        struct {")
cpp_quote("#ifdef _MAC")
cpp_quote("            ULONG Mid32;")
cpp_quote("            ULONG Lo32;")
cpp_quote("#else")
cpp_quote("            ULONG Lo32;")
cpp_quote("            ULONG Mid32;")
cpp_quote("#endif")
cpp_quote("        };")
cpp_quote("        ULONGLONG Lo64;")
cpp_quote("    };")
cpp_quote("} DECIMAL;")

cpp_quote("#define DECIMAL_NEG ((BYTE)0x80)")
cpp_quote("#define DECIMAL_SETZERO(dec) \\")
cpp_quote("        {(dec).Lo64 = 0; (dec).Hi32 = 0; (dec).signscale = 0;}")

cpp_quote("#endif /* _tagDEC_DEFINED */")

typedef DECIMAL *LPDECIMAL;

cpp_quote("#if ( _MSC_VER >= 800 )")
cpp_quote("#if _MSC_VER >= 1200")
cpp_quote("#pragma warning(pop)")
cpp_quote("#else")
cpp_quote("#pragma warning(default:4201)")
cpp_quote("#endif")
cpp_quote("#endif")

/* IDL declarations for BSTR how to transmit them */
//
typedef [unique] FLAGGED_WORD_BLOB * wireBSTR;
typedef [wire_marshal( wireBSTR )] OLECHAR *  BSTR;
typedef BSTR * LPBSTR;

cpp_quote("/* 0 == FALSE, -1 == TRUE */")
typedef short VARIANT_BOOL;
cpp_quote("#if !__STDC__ && (_MSC_VER <= 1000)")
cpp_quote("/* For backward compatibility */")
typedef VARIANT_BOOL _VARIANT_BOOL;
cpp_quote("#else")
cpp_quote("/* ANSI C/C++ reserve bool as keyword */")
cpp_quote("#define _VARIANT_BOOL    /##/")
cpp_quote("#endif")
typedef boolean BOOLEAN;

cpp_quote("/* The BSTRBLOB structure is used by some implementations */")
cpp_quote("/* of the IPropertyStorage interface when marshaling BSTRs */")
cpp_quote("/* on systems which don't support BSTR marshaling. */")

cpp_quote("#ifndef _tagBSTRBLOB_DEFINED")
cpp_quote("#define _tagBSTRBLOB_DEFINED")
typedef struct tagBSTRBLOB
{
                          ULONG   cbSize;
    [size_is(cbSize)]     BYTE    *pData;
} BSTRBLOB, *LPBSTRBLOB;
cpp_quote("#endif")

cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)-1)")
cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0)")

cpp_quote("#ifndef _tagBLOB_DEFINED")
cpp_quote("#define _tagBLOB_DEFINED")
cpp_quote("#define _BLOB_DEFINED")
cpp_quote("#define _LPBLOB_DEFINED")
typedef struct tagBLOB {
    ULONG cbSize;
    [size_is(cbSize)]
    BYTE  *pBlobData;
} BLOB, * LPBLOB;
cpp_quote("#endif")

typedef struct tagCLIPDATA {
    ULONG cbSize;       // count that includes sizeof(ulClipFmt)
    long ulClipFmt;     // long to keep alignment
    [size_is(cbSize-4)]
    BYTE * pClipData;   // cbSize-sizeof(ULONG) bytes of data in clipboard format
} CLIPDATA;

cpp_quote("// Macro to calculate the size of the above pClipData")
cpp_quote("#define CBPCLIPDATA(clipdata)    ( (clipdata).cbSize - sizeof((clipdata).ulClipFmt) )")


typedef unsigned short VARTYPE;

// #########################################################################
//
//  VARTYPE
//
// #########################################################################


cpp_quote("/*")
cpp_quote(" * VARENUM usage key,")
cpp_quote(" *")
cpp_quote(" * * [V] - may appear in a VARIANT")
cpp_quote(" * * [T] - may appear in a TYPEDESC")
cpp_quote(" * * [P] - may appear in an OLE property set")
cpp_quote(" * * [S] - may appear in a Safe Array")
cpp_quote(" *")
cpp_quote(" *")
cpp_quote(" *  VT_EMPTY            [V]   [P]     nothing")
cpp_quote(" *  VT_NULL             [V]   [P]     SQL style Null")
cpp_quote(" *  VT_I2               [V][T][P][S]  2 byte signed int")
cpp_quote(" *  VT_I4               [V][T][P][S]  4 byte signed int")
cpp_quote(" *  VT_R4               [V][T][P][S]  4 byte real")
cpp_quote(" *  VT_R8               [V][T][P][S]  8 byte real")
cpp_quote(" *  VT_CY               [V][T][P][S]  currency")
cpp_quote(" *  VT_DATE             [V][T][P][S]  date")
cpp_quote(" *  VT_BSTR             [V][T][P][S]  OLE Automation string")
cpp_quote(" *  VT_DISPATCH         [V][T]   [S]  IDispatch *")
cpp_quote(" *  VT_ERROR            [V][T][P][S]  SCODE")
cpp_quote(" *  VT_BOOL             [V][T][P][S]  True=-1, False=0")
cpp_quote(" *  VT_VARIANT          [V][T][P][S]  VARIANT *")
cpp_quote(" *  VT_UNKNOWN          [V][T]   [S]  IUnknown *")
cpp_quote(" *  VT_DECIMAL          [V][T]   [S]  16 byte fixed point")
cpp_quote(" *  VT_RECORD           [V]   [P][S]  user defined type")
cpp_quote(" *  VT_I1               [V][T][P][s]  signed char")
cpp_quote(" *  VT_UI1              [V][T][P][S]  unsigned char")
cpp_quote(" *  VT_UI2              [V][T][P][S]  unsigned short")
cpp_quote(" *  VT_UI4              [V][T][P][S]  unsigned long")
cpp_quote(" *  VT_I8                  [T][P]     signed 64-bit int")
cpp_quote(" *  VT_UI8                 [T][P]     unsigned 64-bit int")
cpp_quote(" *  VT_INT              [V][T][P][S]  signed machine int")
cpp_quote(" *  VT_UINT             [V][T]   [S]  unsigned machine int")
cpp_quote(" *  VT_INT_PTR             [T]        signed machine register size width")
cpp_quote(" *  VT_UINT_PTR            [T]        unsigned machine register size width")
cpp_quote(" *  VT_VOID                [T]        C style void")
cpp_quote(" *  VT_HRESULT             [T]        Standard return type")
cpp_quote(" *  VT_PTR                 [T]        pointer type")
cpp_quote(" *  VT_SAFEARRAY           [T]        (use VT_ARRAY in VARIANT)")
cpp_quote(" *  VT_CARRAY              [T]        C style array")
cpp_quote(" *  VT_USERDEFINED         [T]        user defined type")
cpp_quote(" *  VT_LPSTR               [T][P]     null terminated string")
cpp_quote(" *  VT_LPWSTR              [T][P]     wide null terminated string")
cpp_quote(" *  VT_FILETIME               [P]     FILETIME")
cpp_quote(" *  VT_BLOB                   [P]     Length prefixed bytes")
cpp_quote(" *  VT_STREAM                 [P]     Name of the stream follows")
cpp_quote(" *  VT_STORAGE                [P]     Name of the storage follows")
cpp_quote(" *  VT_STREAMED_OBJECT        [P]     Stream contains an object")
cpp_quote(" *  VT_STORED_OBJECT          [P]     Storage contains an object")
cpp_quote(" *  VT_VERSIONED_STREAM       [P]     Stream with a GUID version")
cpp_quote(" *  VT_BLOB_OBJECT            [P]     Blob contains an object ")
cpp_quote(" *  VT_CF                     [P]     Clipboard format")
cpp_quote(" *  VT_CLSID                  [P]     A Class ID")
cpp_quote(" *  VT_VECTOR                 [P]     simple counted array")
cpp_quote(" *  VT_ARRAY            [V]           SAFEARRAY*")
cpp_quote(" *  VT_BYREF            [V]           void* for local use")
cpp_quote(" *  VT_BSTR_BLOB                      Reserved for system use")
cpp_quote(" */")

enum VARENUM
{
    VT_EMPTY           = 0,
    VT_NULL            = 1,
    VT_I2              = 2,
    VT_I4              = 3,
    VT_R4              = 4,
    VT_R8              = 5,
    VT_CY              = 6,
    VT_DATE            = 7,
    VT_BSTR            = 8,
    VT_DISPATCH        = 9,
    VT_ERROR           = 10,
    VT_BOOL            = 11,
    VT_VARIANT         = 12,
    VT_UNKNOWN         = 13,
    VT_DECIMAL         = 14,
// VBA reserves 15 for future use
    VT_I1              = 16,
    VT_UI1             = 17,
    VT_UI2             = 18,
    VT_UI4             = 19,
    VT_I8              = 20,
    VT_UI8             = 21,
    VT_INT             = 22,
    VT_UINT            = 23,
    VT_VOID            = 24,
    VT_HRESULT         = 25,
    VT_PTR             = 26,
    VT_SAFEARRAY       = 27,
    VT_CARRAY          = 28,
    VT_USERDEFINED     = 29,
    VT_LPSTR           = 30,
    VT_LPWSTR          = 31,
// VBA reserves 32-35 for future use
    VT_RECORD          = 36,
	VT_INT_PTR         = 37,
	VT_UINT_PTR        = 38,	

    VT_FILETIME        = 64,
    VT_BLOB            = 65,
    VT_STREAM          = 66,
    VT_STORAGE         = 67,
    VT_STREAMED_OBJECT = 68,
    VT_STORED_OBJECT   = 69,
    VT_BLOB_OBJECT     = 70,
    VT_CF              = 71,
    VT_CLSID           = 72,
    VT_VERSIONED_STREAM= 73,

    VT_BSTR_BLOB       = 0x0fff,

    VT_VECTOR          = 0x1000,
    VT_ARRAY           = 0x2000,
    VT_BYREF           = 0x4000,
    VT_RESERVED        = 0x8000,

    VT_ILLEGAL         = 0xffff,
    VT_ILLEGALMASKED   = 0x0fff,
    VT_TYPEMASK        = 0x0fff
};


// Property stuff
typedef ULONG PROPID;

// Access Control - ntseapi.h
cpp_quote( "#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED" )
cpp_quote( "#define SID_IDENTIFIER_AUTHORITY_DEFINED" )
typedef struct _SID_IDENTIFIER_AUTHORITY {
    UCHAR Value[6];
} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;
cpp_quote( "#endif" )

cpp_quote( "#ifndef SID_DEFINED" )
cpp_quote( "#define SID_DEFINED" )
typedef struct _SID {
   BYTE Revision;
   BYTE SubAuthorityCount;
   SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
   [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
} SID, *PISID;

typedef struct _SID_AND_ATTRIBUTES {
    SID * Sid;
    DWORD Attributes;
    } SID_AND_ATTRIBUTES, * PSID_AND_ATTRIBUTES;
cpp_quote( "#endif" )


// Class Store types

//
// Platform/Architecture Definition
//
    typedef struct tagCSPLATFORM
    {
        DWORD dwPlatformId;     // This is the OS Platform
        DWORD dwVersionHi;      // Major Version of OS
        DWORD dwVersionLo;      // Minor Version of OS
        DWORD dwProcessorArch;  // This is the Processor Architecure
    } CSPLATFORM;

//
// Query Context Structure
// This contains a list of attributes used to look up a class implementation
//
    typedef struct tagQUERYCONTEXT {
          DWORD      dwContext;         // Execution context
          CSPLATFORM Platform;          // Client Platform/Architecture
          LCID       Locale;            // Locale ID
          DWORD      dwVersionHi;       // Low Version number
          DWORD      dwVersionLo;       // Hi Version number
    } QUERYCONTEXT;


//
// Class Specifier structure
// All means of mapping to a Class ID
// (Union of CLSID, File Extension, ProgId, MimeType, File Ext)
//

    typedef [v1_enum] enum tagTYSPEC {
        TYSPEC_CLSID,
        TYSPEC_FILEEXT,
        TYSPEC_MIMETYPE,
        TYSPEC_FILENAME,
        TYSPEC_PROGID,
        TYSPEC_PACKAGENAME,
        TYSPEC_OBJECTID
    } TYSPEC;

    typedef union switch(DWORD tyspec)
        {
        case TYSPEC_CLSID:
            CLSID   clsid;
        case TYSPEC_FILEEXT:
            LPOLESTR pFileExt;
        case TYSPEC_MIMETYPE:
            LPOLESTR pMimeType;
        case TYSPEC_PROGID:
            LPOLESTR pProgId;
        case TYSPEC_FILENAME:
            LPOLESTR pFileName;
        case TYSPEC_PACKAGENAME:
            struct {
            LPOLESTR pPackageName;
            GUID     PolicyId;
            } ByName;
        case TYSPEC_OBJECTID:
            struct {
            GUID     ObjectId;
            GUID     PolicyId;
            } ByObjectId;
    } uCLSSPEC;





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -