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

📄 wtypes.idl

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

//
// SCODE, HRESULT
//
//
//  Status values are 32 bit values layed out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +-+-----------------------------+-------------------------------+
//  |S|       Facility              |               Code            |
//  +-+-----------------------------+-------------------------------+
//
//  where
//
//      S - is the severity code
//
//          0 - Success
//          1 - Error
//
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//
// SCODE and HRESULT are mktyplib base types.
//
typedef LONG SCODE;
cpp_quote("#ifndef _HRESULT_DEFINED")
cpp_quote("#define _HRESULT_DEFINED")
#if defined(_STRICT_HRESULT)
typedef struct _HRESULT_STRUCT {
        DWORD Data1;
} HRESULT_STRUCT, *PHRESULT_STRUCT;
typedef PHRESULT_STRUCT HRESULT;
#else // defined(_STRICT_HRESULT)
typedef LONG HRESULT;
#endif // defined(_STRICT_HRESULT)
cpp_quote("#endif // !_HRESULT_DEFINED")

typedef SCODE *PSCODE;

cpp_quote("#ifndef __OBJECTID_DEFINED")
cpp_quote("#define __OBJECTID_DEFINED")
cpp_quote("#define _OBJECTID_DEFINED")
typedef struct _OBJECTID     // NOTE!! Order of structure members is important for OFS
{                            // enumeration.
   GUID Lineage;             // Unique for objects copied from same original and copies of.
   unsigned long Uniquifier; // Random, to provide uniqueness within small set with same
} OBJECTID;                  // lineage id.
cpp_quote("#endif // !_OBJECTID_DEFINED")

//The following typedefs are used internally by MIDL.
cpp_quote("#if 0")
    /* MIDL 2.0+ definitions */
    typedef GUID *REFGUID;
    typedef IID *REFIID;
    typedef CLSID *REFCLSID;
    typedef FMTID *REFFMTID;
cpp_quote("#endif // 0")

/************************* Misc types ***********************************/

// Common typdefs used in API paramaters, gleamed from compobj.h

// memory context values; passed to CoGetMalloc
typedef enum tagMEMCTX
{
    MEMCTX_TASK = 1,            // task (private) memory
    MEMCTX_SHARED = 2,          // shared memory (between processes)
    MEMCTX_MACSYSTEM = 3,       // on the mac, the system heap
    // these are mostly for internal use...
    MEMCTX_UNKNOWN = -1,        // unknown context (when asked about it)
    MEMCTX_SAME = -2,           // same context (as some other pointer)
} MEMCTX;


// For IRunningObjectTable::Register
cpp_quote("#ifndef _ROTFLAGS_DEFINED")
cpp_quote("#define _ROTFLAGS_DEFINED")
cpp_quote("#define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1")
cpp_quote("#define ROTFLAGS_ALLOWANYCLIENT 0x2")
cpp_quote("#endif // !_ROTFLAGS_DEFINED")

// Maximum size of comparison buffer for IROTData::GetComparisonData
cpp_quote("#ifndef _ROT_COMPARE_MAX_DEFINED")
cpp_quote("#define _ROT_COMPARE_MAX_DEFINED")
cpp_quote("#define ROT_COMPARE_MAX 2048")
cpp_quote("#endif // !_ROT_COMPARE_MAX_DEFINED")


// class context: used to determine what scope and kind of class object to use
// NOTE: this is a bitwise enum
typedef enum tagCLSCTX
{
    CLSCTX_INPROC_SERVER = 0x01,     // server dll (runs in same process as caller)
    CLSCTX_INPROC_HANDLER = 0x02,    // handler dll (runs in same process as caller)
    CLSCTX_LOCAL_SERVER = 0x04,      // server exe (runs on same machine; diff proc)
    CLSCTX_INPROC_SERVER16 = 0x08,   // 16-bit server dll (runs in same process as caller)
    CLSCTX_REMOTE_SERVER = 0x10,     // remote server exe (runs on different machine)
    CLSCTX_INPROC_HANDLER16 = 0x20,  // 16-bit handler dll (runs in same process as caller)
    CLSCTX_INPROC_SERVERX86 = 0x40,  // Wx86 server dll (runs in same process as caller)
    CLSCTX_INPROC_HANDLERX86 = 0x80, // Wx86 handler dll (runs in same process as caller)
    CLSCTX_ESERVER_HANDLER = 0x100,  // handler dll (runs in the server process)
    CLSCTX_RESERVED = 0x200,         // reserved
    CLSCTX_NO_CODE_DOWNLOAD = 0x400, // disallow code download from the Directory Service (if any) or the internet   -rahulth
    CLSCTX_NO_WX86_TRANSLATION = 0x800,
    CLSCTX_NO_CUSTOM_MARSHAL = 0x1000,
    CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000,
                                     // allow code download from the Directory Service (if any) or the internet
    CLSCTX_NO_FAILURE_LOG = 0x4000,  // do not log messages about activation failure (should one occur) to Event Log
    CLSCTX_DISABLE_AAA   = 0x8000,   // Disable EOAC_DISABLE_AAA capability for this activation only
    CLSCTX_ENABLE_AAA   = 0x10000,   // Enable EOAC_DISABLE_AAA capability for this activation only
    CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000    // Begin this activation from the default context of the current apartment
 } CLSCTX;


// marshaling flags; passed to CoMarshalInterface
typedef enum tagMSHLFLAGS
{
    MSHLFLAGS_NORMAL = 0,       // normal marshaling via proxy/stub
    MSHLFLAGS_TABLESTRONG = 1,  // keep object alive; must explicitly release
    MSHLFLAGS_TABLEWEAK = 2,    // doesn't hold object alive; still must release
    MSHLFLAGS_NOPING = 4,       // remote clients dont 'ping' to keep objects alive
    MSHLFLAGS_RESERVED1 = 8,    // reserved
    MSHLFLAGS_RESERVED2 = 16,   // reserved
    MSHLFLAGS_RESERVED3 = 32,   // reserved
    MSHLFLAGS_RESERVED4 = 64    // reserved
} MSHLFLAGS;


// marshal context: determines the destination context of the marshal operation
typedef enum tagMSHCTX
{
    MSHCTX_LOCAL = 0,           // unmarshal context is local (eg.shared memory)
    MSHCTX_NOSHAREDMEM = 1,     // unmarshal context has no shared memory access
    MSHCTX_DIFFERENTMACHINE = 2,// unmarshal context is on a different machine
    MSHCTX_INPROC = 3,          // unmarshal context is on different thread
    MSHCTX_CROSSCTX = 4         // unmarshal context is on different context
} MSHCTX;


//
// Common typedefs for paramaters used in data view API's, gleamed
// from dvobj.h
//

// Data/View aspect; specifies the desired aspect of the object when
// drawing or getting data.
typedef enum tagDVASPECT
{
    DVASPECT_CONTENT = 1,
    DVASPECT_THUMBNAIL = 2,
    DVASPECT_ICON = 4,
    DVASPECT_DOCPRINT = 8
} DVASPECT;

/****** Storage types *************************************************/


/* Storage commit types */
typedef enum tagSTGC
{
    STGC_DEFAULT        = 0,
    STGC_OVERWRITE      = 1,
    STGC_ONLYIFCURRENT  = 2,
    STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4,
    STGC_CONSOLIDATE    = 8
} STGC;


typedef enum tagSTGMOVE
{
    STGMOVE_MOVE    = 0,
    STGMOVE_COPY    = 1,
    STGMOVE_SHALLOWCOPY = 2
} STGMOVE;

typedef enum tagSTATFLAG
{
    STATFLAG_DEFAULT = 0,
    STATFLAG_NONAME = 1,
    STATFLAG_NOOPEN = 2
} STATFLAG;


typedef [context_handle] void *HCONTEXT;

/****** Critical Section Wrappers ***********************************/


/* if not already picked up from olenls.h */
cpp_quote("#ifndef _LCID_DEFINED")
cpp_quote("#define _LCID_DEFINED")
typedef DWORD LCID;
cpp_quote("#endif // !_LCID_DEFINED")

cpp_quote("#ifndef _LANGID_DEFINED")
cpp_quote("#define _LANGID_DEFINED")
typedef USHORT LANGID;
cpp_quote("#endif // !_LANGID_DEFINED")


// #######################################################################
//
//  User marshal support for Windows data types.

//
//  Frequently used helpers: sized blobs
//
//      Never put [user_marshal] or [wire_marshal] on the helpers directly.
//

// Simple blobs.

typedef struct _BYTE_BLOB {
                        unsigned long   clSize;
    [size_is(clSize)]   byte            abData[];
} BYTE_BLOB;

typedef [unique] BYTE_BLOB * UP_BYTE_BLOB;

typedef struct _WORD_BLOB {
                        unsigned long   clSize;
    [size_is(clSize)]   unsigned short  asData[];
} WORD_BLOB;

typedef [unique] WORD_BLOB * UP_WORD_BLOB;

typedef struct _DWORD_BLOB {
                        unsigned long   clSize;
    [size_is(clSize)]   unsigned long   alData[];
} DWORD_BLOB;

typedef [unique] DWORD_BLOB * UP_DWORD_BLOB;

// Flagged blobs.

typedef struct _FLAGGED_BYTE_BLOB {
                        unsigned long   fFlags;
                        unsigned long   clSize;
    [size_is(clSize)]   byte            abData[];
} FLAGGED_BYTE_BLOB;

typedef [unique] FLAGGED_BYTE_BLOB * UP_FLAGGED_BYTE_BLOB;

typedef struct _FLAGGED_WORD_BLOB {
                        unsigned long   fFlags;
                        unsigned long   clSize;
    [size_is(clSize)]   unsigned short  asData[];
} FLAGGED_WORD_BLOB;

typedef [unique] FLAGGED_WORD_BLOB * UP_FLAGGED_WORD_BLOB;

// Frequently used helpers with sized pointers.

typedef struct _BYTE_SIZEDARR {
                        unsigned long   clSize;
    [size_is(clSize)]   byte     *      pData ;
} BYTE_SIZEDARR;

typedef struct _SHORT_SIZEDARR {
                        unsigned long   clSize;
    [size_is(clSize)]   unsigned short* pData ;
} WORD_SIZEDARR;

typedef struct _LONG_SIZEDARR {
                        unsigned long   clSize;
    [size_is(clSize)]   unsigned long * pData ;
} DWORD_SIZEDARR;

typedef struct _HYPER_SIZEDARR {
                        unsigned long   clSize;
    [size_is(clSize)]   hyper         * pData ;
} HYPER_SIZEDARR;


// #########################################################################
//
//   Constants for the call context
//

const unsigned long WDT_INPROC_CALL   = 0x48746457;
const unsigned long WDT_REMOTE_CALL   = 0x52746457;
const unsigned long WDT_INPROC64_CALL = 0x50746457;


// #########################################################################
//
//  CLIPFORMAT
//

typedef union _userCLIPFORMAT switch(long fContext) u
{
    case WDT_INPROC_CALL:            DWORD     dwValue;
    case WDT_REMOTE_CALL:   [string] wchar_t * pwszName;
} userCLIPFORMAT;

typedef [unique] userCLIPFORMAT *  wireCLIPFORMAT;

typedef [wire_marshal(wireCLIPFORMAT)] WORD  CLIPFORMAT;


// #########################################################################
//
//  Good for most of the gdi handles.

typedef union _GDI_NONREMOTE switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long        hInproc;
    case WDT_REMOTE_CALL:   DWORD_BLOB *hRemote;
} GDI_NONREMOTE;

// #########################################################################
//
//  HGLOBAL
//
// A global may be Null or may be non-NULL with 0 length.

typedef union _userHGLOBAL switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long                    hInproc;
    case WDT_REMOTE_CALL:   FLAGGED_BYTE_BLOB *     hRemote;
    case WDT_INPROC64_CALL: __int64                 hInproc64;
} userHGLOBAL;

typedef [unique] userHGLOBAL       * wireHGLOBAL;

// #########################################################################
//
//  HMETAFILE
//

typedef union _userHMETAFILE switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long            hInproc;
    case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
    case WDT_INPROC64_CALL: __int64         hInproc64;
} userHMETAFILE;

// #########################################################################
//
//  HMETAFILEPICT
//
typedef struct _remoteMETAFILEPICT
{
    long            mm;
    long            xExt;
    long            yExt;
    userHMETAFILE * hMF;
} remoteMETAFILEPICT;

typedef union _userHMETAFILEPICT switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long                hInproc;
    case WDT_REMOTE_CALL:   remoteMETAFILEPICT* hRemote;
    case WDT_INPROC64_CALL: __int64             hInproc64;
} userHMETAFILEPICT;

// #########################################################################
//
//  HENHMETAFILE
//

typedef union _userHENHMETAFILE switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long            hInproc;
    case WDT_REMOTE_CALL:   BYTE_BLOB *     hRemote;
    case WDT_INPROC64_CALL: __int64         hInproc64;
} userHENHMETAFILE;

// #########################################################################
//
//  HBITMAP
//

// RemHBITMAP was just a byte blob, but the whole bitmap structure was copied
// at the beginning of the buffer.

// So, we take BITMAP fields from wingdi.x

typedef struct _userBITMAP
{
    LONG            bmType;
    LONG            bmWidth;
    LONG            bmHeight;
    LONG            bmWidthBytes;
    WORD            bmPlanes;
    WORD            bmBitsPixel;
    ULONG                       cbSize;
    [size_is(cbSize)]   byte    pBuffer[];
} userBITMAP;


typedef union _userHBITMAP switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long            hInproc;
    case WDT_REMOTE_CALL:   userBITMAP *    hRemote;
    case WDT_INPROC64_CALL: __int64         hInproc64;
} userHBITMAP;

// #########################################################################
//
//  HPALETTE
//

// PALETTEENTRY is in wingdi.x, it is a struct with 4 bytes.
// LOGPALETTE   is in wingdi.x, it is a conf struct with paletteentries and
//                                    a version field

typedef union _userHPALETTE switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long            hInproc;
    case WDT_REMOTE_CALL:   LOGPALETTE *    hRemote;
    case WDT_INPROC64_CALL: __int64         hInproc64;
} userHPALETTE;

// #########################################################################
//
//  Handles passed locally as longs.
//

typedef union _RemotableHandle switch( long fContext ) u
{
    case WDT_INPROC_CALL:   long   hInproc;
    case WDT_REMOTE_CALL:   long   hRemote;
} RemotableHandle;

typedef [unique] RemotableHandle * wireHWND;
typedef [unique] RemotableHandle * wireHMENU;
typedef [unique] RemotableHandle * wireHACCEL;
typedef [unique] RemotableHandle * wireHBRUSH;
typedef [unique] RemotableHandle * wireHFONT;
typedef [unique] RemotableHandle * wireHDC;
typedef [unique] RemotableHandle * wireHICON;


cpp_quote("#if 0")
#ifndef _MIDL_DECLARE_WIREM_HANDLE
DECLARE_WIREM_HANDLE( HWND );
DECLARE_WIREM_HANDLE( HMENU );
DECLARE_WIREM_HANDLE( HACCEL );
DECLARE_WIREM_HANDLE( HBRUSH );
DECLARE_WIREM_HANDLE( HFONT );
DECLARE_WIREM_HANDLE( HDC );
DECLARE_WIREM_HANDLE( HICON );
#endif

cpp_quote("#ifndef _HCURSOR_DEFINED")
cpp_quote("#define _HCURSOR_DEFINED")
typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
cpp_quote("#endif // !_HCURSOR_DEFINED")

⌨️ 快捷键说明

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