//-------------------------------------------------------------------------- // DirectDB.idl //-------------------------------------------------------------------------- import "ocidl.idl"; import "objidl.idl"; //-------------------------------------------------------------------------- // Dependencies //-------------------------------------------------------------------------- cpp_quote("#include // for offsetof") //-------------------------------------------------------------------------- // Interfaces //-------------------------------------------------------------------------- interface IDatabaseSession; interface IDatabase; interface IDatabaseProgress; interface IDatabaseNotify; interface IDatabaseExtension; interface IDatabaseStream; interface IDatabaseQuery; //-------------------------------------------------------------------------- // Class Ids and Interface Ids //-------------------------------------------------------------------------- cpp_quote("// {4A16043F-676D-11d2-994E-00C04FA309D4}") cpp_quote("DEFINE_GUID(CLSID_DatabaseSession, 0x4a16043f, 0x676d, 0x11d2, 0x99, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {4A160440-676D-11d2-994E-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseSession, 0x4a160440, 0x676d, 0x11d2, 0x99, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {7157F0AE-967B-11d1-9A08-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabase, 0x7157f0ae, 0x967b, 0x11d1, 0x9a, 0x8, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {8CA77091-7B1C-11d2-995F-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_CDatabase, 0x8ca77091, 0x7b1c, 0x11d2, 0x99, 0x5f, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {82EAD219-A6EC-11d1-9A11-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseStream, 0x82ead219, 0xa6ec, 0x11d1, 0x9a, 0x11, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {80C42C87-63C1-11d2-9949-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_CDatabaseStream, 0x80c42c87, 0x63c1, 0x11d2, 0x99, 0x49, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {5E8A5021-AC7C-11d1-9A16-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseProgress, 0x5e8a5021, 0xac7c, 0x11d1, 0x9a, 0x16, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {5E8A5022-AC7C-11d1-9A16-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseNotify, 0x5e8a5022, 0xac7c, 0x11d1, 0x9a, 0x16, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {B58A0F80-0702-11d2-9A63-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseExtension, 0xb58a0f80, 0x702, 0x11d2, 0x9a, 0x63, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") cpp_quote("") cpp_quote("// {E6CEC131-7F4B-11d2-9962-00C04FA309D4}") cpp_quote("DEFINE_GUID(IID_IDatabaseQuery, 0xe6cec131, 0x7f4b, 0x11d2, 0x99, 0x62, 0x0, 0xc0, 0x4f, 0xa3, 0x9, 0xd4);") //-------------------------------------------------------------------------- // HRESULT Macros //-------------------------------------------------------------------------- cpp_quote("#ifndef FACILITY_INTERNET") cpp_quote("#define FACILITY_INTERNET 12") cpp_quote("#endif") cpp_quote("#ifndef HR_E") cpp_quote("#define HR_E(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_INTERNET, n)") cpp_quote("#endif") cpp_quote("#ifndef HR_S") cpp_quote("#define HR_S(n) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_INTERNET, n)") cpp_quote("#endif") cpp_quote("#ifndef HR_CODE") cpp_quote("#define HR_CODE(hr) (INT)(hr & 0xffff)") cpp_quote("#endif") cpp_quote("") //-------------------------------------------------------------------------- // DirectDB Error HRESULTS //-------------------------------------------------------------------------- cpp_quote("#define DB_E_ALREADYOPEN HR_E(300)") cpp_quote("#define DB_E_CREATEMUTEX HR_E(301)") cpp_quote("#define DB_E_CREATEFILE HR_E(302)") cpp_quote("#define DB_E_GETFILESIZE HR_E(303)") cpp_quote("#define DB_E_CREATEFILEMAPPING HR_E(304)") cpp_quote("#define DB_E_MAPVIEWOFFILE HR_E(305)") cpp_quote("#define DB_E_SETENDOFFILE HR_E(306)") cpp_quote("#define DB_E_SETFILEPOINTER HR_E(307)") cpp_quote("#define DB_E_BADMAJORVERSION HR_E(308)") cpp_quote("#define DB_E_INVALIDFILESIGNATURE HR_E(309)") cpp_quote("#define DB_E_WRITEFILE HR_E(310)") cpp_quote("#define DB_E_TIMEOUT HR_E(311)") cpp_quote("#define DB_E_FLUSHVIEWOFFILE HR_E(312)") cpp_quote("#define DB_E_FLUSHFILEBUFFERS HR_E(313)") cpp_quote("#define DB_E_DUPLICATE HR_E(314)") cpp_quote("#define DB_E_CORRUPT HR_E(315)") cpp_quote("#define DB_E_DISKFULL HR_E(316)") cpp_quote("#define DB_E_GETTEMPFILENAME HR_E(317)") cpp_quote("#define DB_E_NOTFOUND HR_E(318)") cpp_quote("#define DB_E_STREAMTABLEFULL HR_E(319)") cpp_quote("#define DB_E_NORECORDS HR_E(320)") cpp_quote("#define DB_E_COMPACT_PREEMPTED HR_E(321)") cpp_quote("#define DB_E_DATABASE_CHANGED HR_E(322)") cpp_quote("#define DB_E_COMPACTING HR_E(323)") cpp_quote("#define DB_E_RECORDVERSIONCHANGED HR_E(324)") cpp_quote("#define DB_E_CORRUPTRECORD HR_E(325)") cpp_quote("#define DB_E_BADMINORVERSION HR_E(326)") cpp_quote("#define DB_E_BADEXTENSIONCLSID HR_E(327)") cpp_quote("#define DB_E_TOOMANYOPENROWSETS HR_E(328)") cpp_quote("#define DB_E_LOCKEDFORREAD HR_E(329)") cpp_quote("#define DB_E_LOCKEDFORWRITE HR_E(330)") cpp_quote("#define DB_E_FILENOTFOUND HR_E(331)") cpp_quote("#define DB_E_UNMATCHINGQUOTES HR_E(332)") cpp_quote("#define DB_E_UNMATCHINGPARENS HR_E(333)") cpp_quote("#define DB_E_NUMBERTOOBIG HR_E(334)") cpp_quote("#define DB_E_BADNUMBER HR_E(335)") cpp_quote("#define DB_E_NOSYMBOLS HR_E(336)") cpp_quote("#define DB_E_INVALIDSYMBOL HR_E(337)") cpp_quote("#define DB_E_INVALIDCOLUMN HR_E(338)") cpp_quote("#define DB_E_BADEXPRESSION HR_E(339)") cpp_quote("#define DB_E_MOVEFILE HR_E(340)") cpp_quote("#define DB_E_ACCESSDENIED HR_E(341)") cpp_quote("#define DB_E_WRONGTHREAD HR_E(342)") cpp_quote("#define DB_E_ALREADYREGISTERED HR_E(343)") //-------------------------------------------------------------------------- // DirectDB Error HRESULTS //-------------------------------------------------------------------------- cpp_quote("#define DB_S_FOUND HR_S(800)") cpp_quote("#define DB_S_NOTFOUND HR_S(801)") //-------------------------------------------------------------------------- // sizeofMember //-------------------------------------------------------------------------- cpp_quote("#define sizeofMember(s,m) sizeof(((s *)0)->m)") //-------------------------------------------------------------------------- // DECLARE_HANDLE Macro //-------------------------------------------------------------------------- #ifndef DECLARE_HANDLE #define DECLARE_HANDLE(name) \ struct name##__ { DWORD unused; }; \ typedef struct name##__ _far* name #endif // OE team hasn't fixed their idl to avoid the Win64 midl warnings - turn it off midl_pragma warning(disable:2395) //-------------------------------------------------------------------------- // DirectDB Type Library //-------------------------------------------------------------------------- [ uuid(E462D143-5162-11d1-8A95-00C04FB951F3), helpstring("Microsoft DirectDB Type Library 1.0"), version(1.0) ] library DirectDB { //---------------------------------------------------------------------- // Standard Type Library Stuff //---------------------------------------------------------------------- importlib("stdole2.tlb"); //---------------------------------------------------------------------- // IDatabase //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASE_DEFINED") cpp_quote("#define __LPDATABASE_DEFINED") [ object, uuid(7157F0AE-967B-11d1-9A08-00C04FA309D4), pointer_default(unique) ] interface IDatabase : IUnknown { //------------------------------------------------------------------ // Pointer to an interface of this type //------------------------------------------------------------------ typedef IDatabase *LPDATABASE; //------------------------------------------------------------------ // Constants //------------------------------------------------------------------ const DWORD CMAX_INDEXES = 8; const DWORD CMAX_KEYS = 8; const DWORD COLUMNS_ALL = 0xFFFFFFFF; //------------------------------------------------------------------ // Reserved Unique Ids //------------------------------------------------------------------ const DWORD RESERVED_ID_MIN = 0xFFFFFBFF; const DWORD RESERVED_ID_MAX = 0xFFFFFFFF; //------------------------------------------------------------------ // HROWSET //------------------------------------------------------------------ DECLARE_HANDLE(HROWSET); typedef HROWSET *LPHROWSET; const HROWSET HROWSET_INVALID = (HROWSET) 0x00000000; //------------------------------------------------------------------ // HLOCK //------------------------------------------------------------------ DECLARE_HANDLE(HLOCK); typedef HLOCK *LPHLOCK; //------------------------------------------------------------------ // METHODID //------------------------------------------------------------------ typedef DWORD METHODID; //------------------------------------------------------------------ // SEEKROWSETTYPE //------------------------------------------------------------------ typedef enum tagSEEKROWSETTYPE { SEEK_ROWSET_BEGIN, SEEK_ROWSET_CURRENT, SEEK_ROWSET_END } SEEKROWSETTYPE; //------------------------------------------------------------------ // TRANSACTIONTYPE //------------------------------------------------------------------ typedef enum tagTRANSACTIONTYPE { TRANSACTION_INSERT, TRANSACTION_UPDATE, TRANSACTION_DELETE, TRANSACTION_INDEX_CHANGED, TRANSACTION_INDEX_DELETED, TRANSACTION_COMPACTED } TRANSACTIONTYPE, *LPTRANSACTIONTYPE; //------------------------------------------------------------------ // HTRANSACTION //------------------------------------------------------------------ DECLARE_HANDLE(HTRANSACTION); typedef HTRANSACTION *LPHTRANSACTION; //------------------------------------------------------------------ // FILEADDRESS //------------------------------------------------------------------ typedef DWORD FILEADDRESS; typedef LPDWORD LPFILEADDRESS; //------------------------------------------------------------------ // INDEXORDINAL //------------------------------------------------------------------ typedef DWORD INDEXORDINAL; typedef LPDWORD LPINDEXORDINAL; cpp_quote("#define INVALID_INDEX_ORDINAL 0xFFFFFFFF") //------------------------------------------------------------------ // COLUMNORDINAL //------------------------------------------------------------------ typedef BYTE COLUMNORDINAL; typedef BYTE *LPCOLUMNORDINAL; //------------------------------------------------------------------ // COMPACTFLAGS //------------------------------------------------------------------ typedef DWORD COMPACTFLAGS; cpp_quote("#define COMPACT_PREEMPTABLE 0x00000001") cpp_quote("#define COMPACT_YIELD 0x00000002") //------------------------------------------------------------------ // LOCKNOTIFYFLAGS //------------------------------------------------------------------ typedef DWORD LOCKNOTIFYFLAGS; //------------------------------------------------------------------ // REGISTERNOTIFYFLAGS //------------------------------------------------------------------ typedef DWORD REGISTERNOTIFYFLAGS; cpp_quote("#define REGISTER_NOTIFY_NOADDREF 0x00000001") cpp_quote("#define REGISTER_NOTIFY_ORDINALSONLY 0x00000002") //------------------------------------------------------------------ // COMPAREFLAGS //------------------------------------------------------------------ typedef BYTE COMPAREFLAGS; cpp_quote("#define COMPARE_IGNORECASE 0x00000001") cpp_quote("#define COMPARE_DESCENDING 0x00000002") cpp_quote("#define COMPARE_ASANSI 0x00000004") //------------------------------------------------------------------ // TABLESCHEMAFLAGS //------------------------------------------------------------------ typedef DWORD TABLESCHEMAFLAGS; cpp_quote("#define TSF_RESETIFBADVERSION 0x00000001") cpp_quote("#define TSF_HASSTREAMS 0x00000002") cpp_quote("#define TSF_HASEXTENSION 0x00000004") //------------------------------------------------------------------ // CREATEROWSETFLAGS //------------------------------------------------------------------ typedef DWORD CREATEROWSETFLAGS; //------------------------------------------------------------------ // INDEXFLAGS //------------------------------------------------------------------ typedef BYTE INDEXFLAGS; cpp_quote("#define INDEX_DESCENDING 0x00000001") //------------------------------------------------------------------ // INDEXORDINAL //------------------------------------------------------------------ cpp_quote("#define IINDEX_PRIMARY 0") //------------------------------------------------------------------ // ROWORDINAL //------------------------------------------------------------------ typedef DWORD ROWORDINAL; typedef LPDWORD LPROWORDINAL; const ROWORDINAL INVALID_ROWORDINAL = 0xffffffff; //------------------------------------------------------------------ // ACCESSTYPE //------------------------------------------------------------------ typedef enum tagACCESSTYPE { ACCESS_READ=100, ACCESS_WRITE=200 } ACCESSTYPE; //------------------------------------------------------------------ // COLUMNDATATYPE //------------------------------------------------------------------ typedef enum tagCOLUMNDATATYPE { CDT_FILETIME, CDT_FIXSTRA, CDT_VARSTRA, CDT_BYTE, CDT_DWORD, CDT_WORD, CDT_STREAM, CDT_VARBLOB, CDT_FIXBLOB, CDT_FLAGS, CDT_UNIQUE, CDT_FIXSTRW, CDT_VARSTRW, CDT_LASTTYPE } COLUMNDATATYPE; //------------------------------------------------------------------ // SYMBOLTYPE //------------------------------------------------------------------ typedef enum tagSYMBOLTYPE { SYMBOL_INVALID, SYMBOL_COLUMN, SYMBOL_DWORD, SYMBOL_METHOD } SYMBOLTYPE; //------------------------------------------------------------------ // SYMBOLINFO //------------------------------------------------------------------ typedef struct tagSYMBOLINFO { SYMBOLTYPE tySymbol; LPCSTR pszName; DWORD dwValue; } SYMBOLINFO, *LPSYMBOLINFO; //------------------------------------------------------------------ // SYMBOLTABLE //------------------------------------------------------------------ typedef struct tagSYMBOLTABLE { DWORD cSymbols; SYMBOLINFO rgSymbol[32]; } SYMBOLTABLE, *LPSYMBOLTABLE; typedef SYMBOLTABLE const *LPCSYMBOLTABLE; //------------------------------------------------------------------ // ORDINALLIST //------------------------------------------------------------------ typedef struct tagORDINALLIST { ROWORDINAL rgiRecord1[CMAX_INDEXES]; ROWORDINAL rgiRecord2[CMAX_INDEXES]; } ORDINALLIST, *LPORDINALLIST; //------------------------------------------------------------------ // INDEXKEY - 6 Bytes //------------------------------------------------------------------ #pragma pack(1) typedef struct tagINDEXKEY { COLUMNORDINAL iColumn; // 1 COMPAREFLAGS bCompare; // 2 DWORD dwBits; // 6 } INDEXKEY, *LPINDEXKEY; #pragma pack() typedef INDEXKEY const *LPCINDEXKEY; //------------------------------------------------------------------ // TABLEINDEX - 2 + (8 * 6) = 50 Bytes //------------------------------------------------------------------ #pragma pack(1) typedef struct tagTABLEINDEX { BYTE cKeys; // 2 INDEXFLAGS bFlags; // 4 INDEXKEY rgKey[CMAX_KEYS]; } TABLEINDEX, *LPTABLEINDEX; #pragma pack() typedef TABLEINDEX const *LPCTABLEINDEX; //------------------------------------------------------------------ // TABLECOLUMN //------------------------------------------------------------------ typedef struct tagTABLECOLUMN { COLUMNORDINAL iOrdinal; COLUMNDATATYPE type; DWORD ofBinding; DWORD cbSize; } TABLECOLUMN, *LPTABLECOLUMN; typedef TABLECOLUMN const *LPCTABLECOLUMN; //------------------------------------------------------------------ // TABLESCHEMA //------------------------------------------------------------------ typedef struct tagTABLESCHEMA { const CLSID *pclsidExtension; DWORD cbBinding; DWORD ofMemory; DWORD ofVersion; DWORD dwMinorVersion; TABLESCHEMAFLAGS dwFlags; DWORD cbUserData; DWORD ofUniqueId; BYTE cColumns; LPCTABLECOLUMN prgColumn; LPCTABLEINDEX pPrimaryIndex; LPCSYMBOLTABLE pSymbols; } TABLESCHEMA, *LPTABLESCHEMA; typedef TABLESCHEMA const *LPCTABLESCHEMA; //------------------------------------------------------------------ // BEGIN_TABLE_INDEX //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define BEGIN_TABLE_INDEX(_index, _cKeys) \\") cpp_quote(" extern const TABLEINDEX _index = { _cKeys, 0, {") cpp_quote("#else") cpp_quote("#define BEGIN_TABLE_INDEX(_index, _cKeys)") cpp_quote("#endif") //------------------------------------------------------------------ // DEFINE_KEY //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define DEFINE_KEY(_iColumn, _wCompare, _dwBits) { _iColumn, _wCompare, _dwBits },") cpp_quote("#else") cpp_quote("#define DEFINE_KEY(_iColumn, _wCompare, _dwBits)") cpp_quote("#endif") //------------------------------------------------------------------ // END_TABLE_INDEX //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define END_TABLE_INDEX } };") cpp_quote("#else") cpp_quote("#define END_TABLE_INDEX") cpp_quote("#endif") //------------------------------------------------------------------ // BEGIN_COLUMN_ARRAY //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define BEGIN_COLUMN_ARRAY(_name, _cColumns) const TABLECOLUMN _name[_cColumns] = {") cpp_quote("#else") cpp_quote("#define BEGIN_COLUMN_ARRAY(_name, _cColumns)") cpp_quote("#endif") //------------------------------------------------------------------ // DEFINE_COLUMN //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define DEFINE_COLUMN(_iColumn, _type, _structure, _member)\\") cpp_quote(" { _iColumn, _type, offsetof(_structure, _member), sizeofMember(_structure, _member) },") cpp_quote("#else") cpp_quote("#define DEFINE_COLUMN(_iColumn, _type, _structure, _member)") cpp_quote("#endif") //------------------------------------------------------------------ // END_COLUMN_ARRAY //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define END_COLUMN_ARRAY };") cpp_quote("#else") cpp_quote("#define END_COLUMN_ARRAY") cpp_quote("#endif") //------------------------------------------------------------------ // BEGIN_SYMBOL_TABLE //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define BEGIN_SYMBOL_TABLE(_name, _cSymbols) \\") cpp_quote(" extern const SYMBOLTABLE _name = { _cSymbols, {") cpp_quote("#else") cpp_quote("#define BEGIN_SYMBOL_TABLE(_name, _cSymbols)") cpp_quote("#endif") //------------------------------------------------------------------ // DEFINE_SYMBOL //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define DEFINE_SYMBOL(_tySymbol, _pszName, _dwValue) \\") cpp_quote(" { _tySymbol, (LPCSTR)_pszName, _dwValue },") cpp_quote("#else") cpp_quote("#define DEFINE_SYMBOL(_tySymbol, _pszName, _dwValue)") cpp_quote("#endif") //------------------------------------------------------------------ // END_SYMBOL_TABLE //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define END_SYMBOL_TABLE } };") cpp_quote("#else") cpp_quote("#define END_SYMBOL_TABLE") cpp_quote("#endif") //------------------------------------------------------------------ // BEGIN_TABLE_SCHEMA //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define BEGIN_TABLE_SCHEMA(_schema, _clsid, _binding) \\") cpp_quote(" extern const TABLESCHEMA _schema = { \\") cpp_quote(" &_clsid,\\") cpp_quote(" sizeof(_binding),\\") cpp_quote(" offsetof(_binding, pAllocated),\\") cpp_quote(" offsetof(_binding, bVersion),") cpp_quote("#else") cpp_quote("#define BEGIN_TABLE_SCHEMA(_schema, _clsid, _binding)") cpp_quote("#endif") //------------------------------------------------------------------ // SCHEMA_PROPERTY //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define SCHEMA_PROPERTY(_value) \\") cpp_quote(" _value,") cpp_quote("#else") cpp_quote("#define SCHEMA_PROPERTY(_value)") cpp_quote("#endif") //------------------------------------------------------------------ // END_TABLE_SCHEMA //------------------------------------------------------------------ cpp_quote("#ifdef DEFINE_DIRECTDB") cpp_quote("#define END_TABLE_SCHEMA };") cpp_quote("#else") cpp_quote("#define END_TABLE_SCHEMA") cpp_quote("#endif") //------------------------------------------------------------------ // Locking Methods //------------------------------------------------------------------ HRESULT Lock( [out] LPHLOCK phLock); HRESULT Unlock( [out] LPHLOCK phLock); //------------------------------------------------------------------ // Data Manipulation Methods //------------------------------------------------------------------ HRESULT InsertRecord( [in] LPVOID pRecord); HRESULT UpdateRecord( [in] LPVOID pRecord); HRESULT DeleteRecord( [in] LPVOID pRecord); HRESULT FindRecord( [in] INDEXORDINAL iIndex, [in] DWORD cColumns, // Use COLUMNS_ALL to compare all columns of the index [in,out] LPVOID pRecord, [out] LPROWORDINAL piRow); HRESULT GetRowOrdinal( [in] INDEXORDINAL iIndex, [in] LPVOID pRecord, [out] LPROWORDINAL piRow); HRESULT FreeRecord( [in,out] LPVOID pRecord); HRESULT GetUserData( [in,out] LPVOID pvUserData, [in] ULONG cbUserData); HRESULT SetUserData( [in] LPVOID pvUserData, [in] ULONG cbUserData); HRESULT GetRecordCount( [in] INDEXORDINAL iIndex, [out] LPDWORD pcRecords); //------------------------------------------------------------------ // Schema Methods //------------------------------------------------------------------ HRESULT GetIndexInfo( [in] INDEXORDINAL iIndex, [out] LPSTR *ppszFilter, [out] LPTABLEINDEX pIndex); HRESULT ModifyIndex( [in] INDEXORDINAL iIndex, [in] LPCSTR pszFilter, [in] LPCTABLEINDEX pIndex); HRESULT DeleteIndex( [in] INDEXORDINAL iIndex); //------------------------------------------------------------------ // Rowset Methods //------------------------------------------------------------------ HRESULT CreateRowset( [in] INDEXORDINAL iIndex, [in] CREATEROWSETFLAGS dwFlags, [out] LPHROWSET phRowset); HRESULT SeekRowset( [in] HROWSET hRowset, [in] SEEKROWSETTYPE tySeek, [in] LONG cRows, [out] LPROWORDINAL piRowNew); HRESULT QueryRowset( [in] HROWSET hRowset, [in] LONG cWanted, [in,out] LPVOID *prgpRecord, [out] LPDWORD pcObtained); HRESULT CloseRowset( [in,out] LPHROWSET phRowset); //------------------------------------------------------------------ // Steaming Methods //------------------------------------------------------------------ HRESULT CreateStream( [out] LPFILEADDRESS pfaStart); HRESULT DeleteStream( [in] FILEADDRESS faStart); HRESULT CopyStream( [in] IDatabase *pDest, [in] FILEADDRESS faStream, [out] LPFILEADDRESS pfaNew); HRESULT OpenStream( [in] ACCESSTYPE tyAccess, [in] FILEADDRESS faStream, [out] IStream **ppStream); HRESULT ChangeStreamLock( [in] IStream *pStream, [in] ACCESSTYPE tyAccessNew); //------------------------------------------------------------------ // Notification Methods //------------------------------------------------------------------ HRESULT RegisterNotify( [in] INDEXORDINAL iIndex, [in] REGISTERNOTIFYFLAGS dwFlags, [in] DWORD_PTR dwCookie, [in] IDatabaseNotify *pNotify); HRESULT DispatchNotify( [in] IDatabaseNotify *pNotify); HRESULT SuspendNotify( [in] IDatabaseNotify *pNotify); HRESULT ResumeNotify( [in] IDatabaseNotify *pNotify); HRESULT UnregisterNotify( [in] IDatabaseNotify *pNotify); HRESULT LockNotify( [in] LOCKNOTIFYFLAGS dwFlags, [out] LPHLOCK phLock); HRESULT UnlockNotify( [in,out] LPHLOCK phLock); HRESULT GetTransaction( [in,out] LPHTRANSACTION phTransaction, [out] LPTRANSACTIONTYPE ptyTransaction, [in] LPVOID pRecord1, [in] LPVOID pRecord2, [in,out] LPINDEXORDINAL piIndex, [in] LPORDINALLIST pOrdinals); //------------------------------------------------------------------ // Maintenence Methods //------------------------------------------------------------------ HRESULT MoveFile( [in] LPCWSTR pwszFilePath); HRESULT SetSize( [in] DWORD cbSize); HRESULT Repair(void); HRESULT Compact( [in] IDatabaseProgress *pProgress, [in] COMPACTFLAGS dwFlags); //------------------------------------------------------------------ // Fast-Heap Methods //------------------------------------------------------------------ HRESULT HeapAllocate( [in] DWORD dwFlags, // HEAP_xxx Flags normally passed to HeapAlloc [in] DWORD cbSize, [out] LPVOID *ppBuffer); HRESULT HeapFree( [in] LPVOID pBuffer); //------------------------------------------------------------------ // General Utility Methods //------------------------------------------------------------------ HRESULT GenerateId( [out] LPDWORD pdwId); HRESULT GetClientCount( [out] LPDWORD pcClients); HRESULT GetFile( [out] LPWSTR *ppwszFile); HRESULT GetSize( [out] LPDWORD pcbFile, [out] LPDWORD pcbAllocated, [out] LPDWORD pcbFreed, [out] LPDWORD pcbStreams); } cpp_quote("#endif // __LPDATABASE_DEFINED") //---------------------------------------------------------------------- // IDatabaseSession //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASESESSION_DEFINED") cpp_quote("#define __LPDATABASESESSION_DEFINED") [ object, uuid(4A160440-676D-11d2-994E-00C04FA309D4), pointer_default(unique) ] interface IDatabaseSession : IUnknown { //------------------------------------------------------------------ // Pointer to an interface of this type //------------------------------------------------------------------ typedef IDatabaseSession *LPDATABASESESSION; //------------------------------------------------------------------ // OPENDATABASEFLAGS //------------------------------------------------------------------ typedef DWORD OPENDATABASEFLAGS; cpp_quote("#define OPEN_DATABASE_NORESET 0x00000001") cpp_quote("#define OPEN_DATABASE_NOADDREFEXT 0x00000002") cpp_quote("#define OPEN_DATABASE_NOEXTENSION 0x00000004") //cpp_quote("#define OPEN_DATABASE_NOREPAIRUI 0x00000008") cpp_quote("#define OPEN_DATABASE_NOMONITOR 0x00000010") cpp_quote("#define OPEN_DATABASE_EXCLUSEIVE 0x00000020") cpp_quote("#define OPEN_DATABASE_NOCREATE 0x00000040") //------------------------------------------------------------------ // Members //------------------------------------------------------------------ HRESULT OpenDatabase( [in] LPCSTR pszFile, [in] OPENDATABASEFLAGS dwFlags, [in] LPCTABLESCHEMA pSchema, [in] IDatabaseExtension *pExtension, [out] IDatabase **ppDB); HRESULT OpenDatabaseW( [in] LPCWSTR pwszFile, [in] OPENDATABASEFLAGS dwFlags, [in] LPCTABLESCHEMA pSchema, [in] IDatabaseExtension *pExtension, [out] IDatabase **ppDB); HRESULT OpenQuery( [in] IDatabase *pDatabase, [in] LPCSTR pszQuery, [out] IDatabaseQuery **ppQuery); } cpp_quote("#endif // __LPDATABASESESSION_DEFINED") //---------------------------------------------------------------------- // IDatabaseExtension //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASEEXTENSION_DEFINED") cpp_quote("#define __LPDATABASEEXTENSION_DEFINED") [ object, uuid(B58A0F80-0702-11d2-9A63-00C04FA309D4), pointer_default(unique) ] interface IDatabaseExtension : IUnknown { //------------------------------------------------------------------ // OPERATIONSTATE //------------------------------------------------------------------ typedef enum tagOPERATIONSTATE { OPERATION_BEFORE, OPERATION_AFTER } OPERATIONSTATE; //------------------------------------------------------------------ // Pointer to an interface of this type //------------------------------------------------------------------ typedef IDatabaseExtension *LPDATABASEEXTENSION; //------------------------------------------------------------------ // Methods //------------------------------------------------------------------ HRESULT Initialize( [in] IDatabase *pDB); HRESULT OnLock(void); HRESULT OnUnlock(void); HRESULT OnRecordInsert( [in] OPERATIONSTATE tyState, [in] LPORDINALLIST pOrdinals, // Only valid when tyState = OPERATION_AFTER [in] LPVOID pRecord); HRESULT OnRecordUpdate( [in] OPERATIONSTATE tyState, [in] LPORDINALLIST pOrdinals, // Only valid when tyState = OPERATION_AFTER [in] LPVOID pRecordOld, [in] LPVOID pRecordNew); HRESULT OnRecordDelete( [in] OPERATIONSTATE tyState, [in] LPORDINALLIST pOrdinals, // Only valid when tyState = OPERATION_AFTER [in] LPVOID pRecord); HRESULT OnExecuteMethod( [in] METHODID idMethod, [in] LPVOID pBinding, [in] LPDWORD pdwResult); } cpp_quote("#endif // __LPDATABASEEXTENSION_DEFINED") //---------------------------------------------------------------------- // IDatabaseNotify //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASENOTIFY_DEFINED") cpp_quote("#define __LPDATABASENOTIFY_DEFINED") [ object, uuid(7CADFB4C-AC65-11d1-9A16-00C04FA309D4), pointer_default(unique) ] interface IDatabaseNotify : IUnknown { //------------------------------------------------------------------ // Pointer to an interface of this type //------------------------------------------------------------------ typedef IDatabaseNotify *LPDATABASENOTIFY; //------------------------------------------------------------------ // Methods //------------------------------------------------------------------ HRESULT OnTransaction( [in] HTRANSACTION hTransaction, [in] DWORD_PTR dwCookie, [in] IDatabase *pDB); } cpp_quote("#endif // __LPDATABASENOTIFY_DEFINED") //---------------------------------------------------------------------- // IDatabaseStream //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASESTREAM_DEFINED") cpp_quote("#define __LPDATABASESTREAM_DEFINED") [ object, uuid(82EAD219-A6EC-11d1-9A11-00C04FA309D4), pointer_default(unique) ] interface IDatabaseStream : IStream { //------------------------------------------------------------------ // Pointer to an interface of this type //------------------------------------------------------------------ typedef IDatabaseStream *LPDATABASESTREAM; //------------------------------------------------------------------ // Methods //------------------------------------------------------------------ HRESULT GetFileAddress( [out] LPFILEADDRESS pfaStream); HRESULT CompareDatabase( [in] IDatabase *pDatabase); } cpp_quote("#endif // __LPDATABASESTREAM_DEFINED") //---------------------------------------------------------------------- // IDatabaseProgress //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASEPROGRESS_DEFINED") cpp_quote("#define __LPDATABASEPROGRESS_DEFINED") [ object, uuid(7CADFB4B-AC65-11d1-9A16-00C04FA309D4), pointer_default(unique) ] interface IDatabaseProgress : IUnknown { HRESULT Update( [in] DWORD cCount); } cpp_quote("#endif // __LPDATABASEPROGRESS_DEFINED") //---------------------------------------------------------------------- // IDatabaseQuery //---------------------------------------------------------------------- cpp_quote("#ifndef __LPDATABASEQUERY_DEFINED") cpp_quote("#define __LPDATABASEQUERY_DEFINED") [ object, uuid(E6CEC131-7F4B-11d2-9962-00C04FA309D4), pointer_default(unique) ] interface IDatabaseQuery : IUnknown { HRESULT Evaluate( [in] LPVOID pBinding); } cpp_quote("#endif // __LPDATABASEQUERY_DEFINED") } // DirectDB Library Object Definition