From 73ec168731af87cc301d7b90961fc911049b2f28 Mon Sep 17 00:00:00 2001 From: Fabio Mascarenhas Date: Fri, 23 Mar 2012 13:28:25 -0300 Subject: [PATCH] added opc security interface --- Makefile.win | 11 +- comgen.cpp | 11 + gen_opc.lua | 38 + mpa/opc.lua | 21 +- opc/opc.h | 1958 +++++++++++++++++++++++++++++++++++++++++++++++ opc/opc_ae.idl | 506 ++++++++++++ opc/opc_i.c | 103 +++ opc/opccomn.h | 899 ++++++++++++++++++++++ opc/opccomn.idl | 241 ++++++ opc/opccomn_i.c | 99 +++ opc/opcsec.h | 370 +++++++++ opc/opcsec.idl | 91 +++ opc/opcsec_i.c | 85 ++ test_opc.lua | 11 +- 14 files changed, 4439 insertions(+), 5 deletions(-) create mode 100644 opc/opc.h create mode 100644 opc/opc_ae.idl create mode 100644 opc/opc_i.c create mode 100644 opc/opccomn.h create mode 100644 opc/opccomn.idl create mode 100644 opc/opccomn_i.c create mode 100644 opc/opcsec.h create mode 100644 opc/opcsec.idl create mode 100644 opc/opcsec_i.c diff --git a/Makefile.win b/Makefile.win index f738e46..990ec33 100644 --- a/Makefile.win +++ b/Makefile.win @@ -45,6 +45,15 @@ opcae_w.obj: opcae_w.cpp opcae.dll: opcae.obj opcae_w.obj link /dll opcae.obj opcae_w.obj $(LUA_LIB) $(OLE_LIB) $(OLEAUT_LIB) /def:opcae.def +opcsec.cpp: gen_opc.lua + $(LUA) -l luarocks.require gen_opc.lua + +opcsec.obj: opcsec.cpp + cl /c /W3 /D_CRT_SECURE_NO_WARNINGS /I$(LUA_INCLUDE_DIR) /Iopc opcsec.cpp + +opcsec.dll: opcsec.obj + link /dll opcsec.obj $(LUA_LIB) $(OLE_LIB) $(OLEAUT_LIB) /def:opcsec.def + connpoint.cpp: gen_connpoint.lua $(LUA) -l luarocks.require gen_connpoint.lua @@ -54,7 +63,7 @@ connpoint.obj: connpoint.cpp connpoint.dll: connpoint.obj link /dll connpoint.obj $(LUA_LIB) $(OLE_LIB) $(OLEAUT_LIB) /def:connpoint.def -all: comgen.dll rectpointlib.dll opclib.dll connpoint.dll opcae.dll +all: comgen.dll rectpointlib.dll opclib.dll connpoint.dll opcae.dll opcsec.dll clean: del *.dll *.obj *.lib *.exp rectpointlib.* opclib.* diff --git a/comgen.cpp b/comgen.cpp index 3da5a4b..6e28086 100644 --- a/comgen.cpp +++ b/comgen.cpp @@ -223,10 +223,21 @@ int comgen_messagestep(lua_State *L) { return 1; } +int comgen_raiseprivacy(lua_State *L) { + IUnknown *p = comgen_checkinterface(L, 1); + HRESULT hr = CoSetProxyBlanket(p, RPC_C_AUTHN_DEFAULT, RPC_C_AUTHN_DEFAULT, NULL, + RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_IMP_LEVEL_DEFAULT, + NULL, EOAC_DEFAULT); + if(!SUCCEEDED(hr)) + return comgen_error(L, hr); + return 1; +} + static luaL_Reg comgen_functions[] = { { "CreateInstance", comgen_createinstance }, { "MessageLoop", comgen_messageloop }, { "MessageStep", comgen_messagestep }, + { "RaisePrivacy", comgen_raiseprivacy }, { NULL, NULL } }; diff --git a/gen_opc.lua b/gen_opc.lua index b79c67a..1861642 100644 --- a/gen_opc.lua +++ b/gen_opc.lua @@ -272,6 +272,31 @@ local IOPCDataCallback = { } } +local IOPCSecurityPrivate = { + name = "IOPCSecurityPrivate", + iid = "{7AA83A02-6C77-11D3-84F9-00008630A38B}", + parent = IUnknown, + methods = { + { + name = "IsAvailablePriv", + parameters = { + { type = types.bool, attributes = { out = true }, name = "pbAvailable" } + } + }, + { + name = "Logon", + parameters = { + { type = types.wstring, attributes = { ["in"] = true }, name = "szUserID" }, + { type = types.wstring, attributes = { ["in"] = true }, name = "szPassword" } + } + }, + { + name = "Logoff", + parameters = {} + } + } +} + local OPCEVENTSERVERSTATE = { name = "OPCEVENTSERVERSTATE", fields = { @@ -509,6 +534,14 @@ local opcae = { enums = { OPCEVENTSERVERSTATE, HRESULT, types.vartype } } +local opcsec = { + modname = "opcsec", + header = "opcsec", + interfaces = { IOPCSecurityPrivate }, + wrappers = {}, + enums = { HRESULT } +} + local source, def, wrap = generator.compile(opcda) generator.writefile("opclib.cpp", source) @@ -520,3 +553,8 @@ local source, def, wrap = generator.compile(opcae) generator.writefile("opcae.cpp", source) generator.writefile("opcae.def", def) generator.writefile("opcae_w.cpp", wrap) + +local source, def, wrap = generator.compile(opcsec) + +generator.writefile("opcsec.cpp", source) +generator.writefile("opcsec.def", def) diff --git a/mpa/opc.lua b/mpa/opc.lua index 2c77cb4..fab8462 100644 --- a/mpa/opc.lua +++ b/mpa/opc.lua @@ -2,6 +2,7 @@ require "comgen" require "opclib" require "connpoint" +pcall(require, "opcsec") module("opc", package.seeall) @@ -14,9 +15,27 @@ methods_v2.__index = methods_v2 local methods_cb = {} methods_cb.__index = methods_cb -function open(server, host, use_v2, async) +function open(server, host, use_v2, async, user, pass) + if type(server) == "table" then + host = server.host + use_v2 = server.use_v2 + async = server.async + user = server.user + pass = server.pass + server = server.server + end local ok, server = pcall(comgen.CreateInstance, server, opclib.IOPCServer, host) if not ok then return nil, "server not found, com error: " .. server end + if user then + local ok, sec = pcall(server.QueryInterface, server, opcsec.IOPCSecurityPrivate) + if not ok then return nil, "OPC Security interface not available: " .. server end + if not sec:IsAvailablePriv() then + return nil, "OPC Security interface not available: " .. server + end + comgen.RaisePrivacy(sec) + local ok = pcall(sec.Logon, sec, user, pass) + if not ok then return nil, "login to server failed: " .. server end + end local ok, itemio = pcall(server.QueryInterface, server, opclib.IOPCItemIO) if ok and (not use_v2) and (not async) then return setmetatable({ server = server, itemio = itemio }, diff --git a/opc/opc.h b/opc/opc.h new file mode 100644 index 0000000..52b8b76 --- /dev/null +++ b/opc/opc.h @@ -0,0 +1,1958 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* at Fri May 07 13:13:29 2010 + */ +/* Compiler settings for opc.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __opc_h__ +#define __opc_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IOPCServer_FWD_DEFINED__ +#define __IOPCServer_FWD_DEFINED__ +typedef interface IOPCServer IOPCServer; +#endif /* __IOPCServer_FWD_DEFINED__ */ + + +#ifndef __IOPCServerPublicGroups_FWD_DEFINED__ +#define __IOPCServerPublicGroups_FWD_DEFINED__ +typedef interface IOPCServerPublicGroups IOPCServerPublicGroups; +#endif /* __IOPCServerPublicGroups_FWD_DEFINED__ */ + + +#ifndef __IOPCBrowseServerAddressSpace_FWD_DEFINED__ +#define __IOPCBrowseServerAddressSpace_FWD_DEFINED__ +typedef interface IOPCBrowseServerAddressSpace IOPCBrowseServerAddressSpace; +#endif /* __IOPCBrowseServerAddressSpace_FWD_DEFINED__ */ + + +#ifndef __IOPCGroupStateMgt_FWD_DEFINED__ +#define __IOPCGroupStateMgt_FWD_DEFINED__ +typedef interface IOPCGroupStateMgt IOPCGroupStateMgt; +#endif /* __IOPCGroupStateMgt_FWD_DEFINED__ */ + + +#ifndef __IOPCPublicGroupStateMgt_FWD_DEFINED__ +#define __IOPCPublicGroupStateMgt_FWD_DEFINED__ +typedef interface IOPCPublicGroupStateMgt IOPCPublicGroupStateMgt; +#endif /* __IOPCPublicGroupStateMgt_FWD_DEFINED__ */ + + +#ifndef __IOPCSyncIO_FWD_DEFINED__ +#define __IOPCSyncIO_FWD_DEFINED__ +typedef interface IOPCSyncIO IOPCSyncIO; +#endif /* __IOPCSyncIO_FWD_DEFINED__ */ + + +#ifndef __IOPCAsyncIO_FWD_DEFINED__ +#define __IOPCAsyncIO_FWD_DEFINED__ +typedef interface IOPCAsyncIO IOPCAsyncIO; +#endif /* __IOPCAsyncIO_FWD_DEFINED__ */ + + +#ifndef __IOPCItemMgt_FWD_DEFINED__ +#define __IOPCItemMgt_FWD_DEFINED__ +typedef interface IOPCItemMgt IOPCItemMgt; +#endif /* __IOPCItemMgt_FWD_DEFINED__ */ + + +#ifndef __IEnumOPCItemAttributes_FWD_DEFINED__ +#define __IEnumOPCItemAttributes_FWD_DEFINED__ +typedef interface IEnumOPCItemAttributes IEnumOPCItemAttributes; +#endif /* __IEnumOPCItemAttributes_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_opc_0000 */ +/* [local] */ + +typedef +enum tagOPCDATASOURCE + { OPC_DS_CACHE = 1, + OPC_DS_DEVICE = OPC_DS_CACHE + 1 + } OPCDATASOURCE; + +typedef +enum tagOPCBROWSETYPE + { OPC_BRANCH = 1, + OPC_LEAF = OPC_BRANCH + 1, + OPC_FLAT = OPC_LEAF + 1 + } OPCBROWSETYPE; + +typedef +enum tagOPCNAMESPACETYPE + { OPC_NS_HIERARCHIAL = 1, + OPC_NS_FLAT = OPC_NS_HIERARCHIAL + 1 + } OPCNAMESPACETYPE; + +typedef +enum tagOPCBROWSEDIRECTION + { OPC_BROWSE_UP = 1, + OPC_BROWSE_DOWN = OPC_BROWSE_UP + 1 + } OPCBROWSEDIRECTION; + +#define OPC_READABLE 1 +#define OPC_WRITEABLE 2 +typedef +enum tagOPCEUTYPE + { OPC_NOENUM = 0, + OPC_ANALOG = OPC_NOENUM + 1, + OPC_ENUMERATED = OPC_ANALOG + 1 + } OPCEUTYPE; + +typedef +enum tagOPCSERVERSTATE + { OPC_STATUS_RUNNING = 1, + OPC_STATUS_FAILED = OPC_STATUS_RUNNING + 1, + OPC_STATUS_NOCONFIG = OPC_STATUS_FAILED + 1, + OPC_STATUS_SUSPENDED = OPC_STATUS_NOCONFIG + 1, + OPC_STATUS_TEST = OPC_STATUS_SUSPENDED + 1 + } OPCSERVERSTATE; + +typedef +enum tagOPCENUMSCOPE + { OPC_ENUM_PRIVATE_CONNECTIONS = 1, + OPC_ENUM_PUBLIC_CONNECTIONS = OPC_ENUM_PRIVATE_CONNECTIONS + 1, + OPC_ENUM_ALL_CONNECTIONS = OPC_ENUM_PUBLIC_CONNECTIONS + 1, + OPC_ENUM_PRIVATE = OPC_ENUM_ALL_CONNECTIONS + 1, + OPC_ENUM_PUBLIC = OPC_ENUM_PRIVATE + 1, + OPC_ENUM_ALL = OPC_ENUM_PUBLIC + 1 + } OPCENUMSCOPE; + +typedef DWORD OPCHANDLE; + +typedef struct tagOPCGROUPHEADER + { + DWORD dwSize; + DWORD dwItemCount; + OPCHANDLE hClientGroup; + DWORD dwTransactionID; + HRESULT hrStatus; + } OPCGROUPHEADER; + +typedef struct tagOPCITEMHEADER1 + { + OPCHANDLE hClient; + DWORD dwValueOffset; + WORD wQuality; + WORD wReserved; + FILETIME ftTimeStampItem; + } OPCITEMHEADER1; + +typedef struct tagOPCITEMHEADER2 + { + OPCHANDLE hClient; + DWORD dwValueOffset; + WORD wQuality; + WORD wReserved; + } OPCITEMHEADER2; + +typedef struct tagOPCGROUPHEADERWRITE + { + DWORD dwItemCount; + OPCHANDLE hClientGroup; + DWORD dwTransactionID; + HRESULT hrStatus; + } OPCGROUPHEADERWRITE; + +typedef struct tagOPCITEMHEADERWRITE + { + OPCHANDLE hClient; + HRESULT dwError; + } OPCITEMHEADERWRITE; + +typedef struct tagOPCITEMSTATE + { + OPCHANDLE hClient; + FILETIME ftTimeStamp; + WORD wQuality; + WORD wReserved; + VARIANT vDataValue; + } OPCITEMSTATE; + +typedef struct tagOPCSERVERSTATUS + { + FILETIME ftStartTime; + FILETIME ftCurrentTime; + FILETIME ftLastUpdateTime; + OPCSERVERSTATE dwServerState; + DWORD dwGroupCount; + DWORD dwBandWidth; + WORD wMajorVersion; + WORD wMinorVersion; + WORD wBuildNumber; + WORD wReserved; + /* [string] */ LPWSTR szVendorInfo; + } OPCSERVERSTATUS; + +typedef struct tagOPCITEMDEF + { + /* [string] */ LPWSTR szAccessPath; + /* [string] */ LPWSTR szItemID; + BOOL bActive; + OPCHANDLE hClient; + DWORD dwBlobSize; + /* [size_is] */ BYTE *pBlob; + VARTYPE vtRequestedDataType; + WORD wReserved; + } OPCITEMDEF; + +typedef struct tagOPCITEMATTRIBUTES + { + /* [string] */ LPWSTR szAccessPath; + /* [string] */ LPWSTR szItemID; + BOOL bActive; + OPCHANDLE hClient; + OPCHANDLE hServer; + DWORD dwAccessRights; + DWORD dwBlobSize; + /* [size_is] */ BYTE *pBlob; + VARTYPE vtRequestedDataType; + VARTYPE vtCanonicalDataType; + OPCEUTYPE dwEUType; + VARIANT vEUInfo; + } OPCITEMATTRIBUTES; + +typedef struct tagOPCITEMRESULT + { + OPCHANDLE hServer; + VARTYPE vtCanonicalDataType; + WORD wReserved; + DWORD dwAccessRights; + DWORD dwBlobSize; + /* [size_is] */ BYTE *pBlob; + } OPCITEMRESULT; + +#define OPC_QUALITY_MASK 0xC0 +#define OPC_STATUS_MASK 0xCC +#define OPC_LIMIT_MASK 0x03 +#define OPC_QUALITY_BAD 0x00 +#define OPC_QUALITY_UNCERTAIN 0x80 +#define OPC_QUALITY_GOOD 0xC0 +#define OPC_QUALITY_CONFIG_ERROR 0x04 +#define OPC_QUALITY_NOT_CONNECTED 0x08 +#define OPC_QUALITY_DEVICE_FAILURE 0x0c +#define OPC_QUALITY_SENSOR_FAILURE 0x10 +#define OPC_QUALITY_LAST_KNOWN 0x14 +#define OPC_QUALITY_COMM_FAILURE 0x18 +#define OPC_QUALITY_OUT_OF_SERVICE 0x1C +#define OPC_QUALITY_LAST_USABLE 0x84 +#define OPC_QUALITY_SENSOR_CAL 0x90 +#define OPC_QUALITY_EGU_EXCEEDED 0x94 +#define OPC_QUALITY_SUB_NORMAL 0x98 +#define OPC_QUALITY_LOCAL_OVERRIDE 0xD8 +#define OPC_LIMIT_OK 0x00 +#define OPC_LIMIT_LOW 0x01 +#define OPC_LIMIT_HIGH 0x02 +#define OPC_LIMIT_CONST 0x03 + + +extern RPC_IF_HANDLE __MIDL_itf_opc_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_opc_0000_v0_0_s_ifspec; + +#ifndef __IOPCServer_INTERFACE_DEFINED__ +#define __IOPCServer_INTERFACE_DEFINED__ + +/* interface IOPCServer */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCServer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a4d-011e-11d0-9675-0020afd8adb3") + IOPCServer : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE AddGroup( + /* [string][in] */ LPCWSTR szName, + /* [in] */ BOOL bActive, + /* [in] */ DWORD dwRequestedUpdateRate, + /* [in] */ OPCHANDLE hClientGroup, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in] */ DWORD dwLCID, + /* [out] */ OPCHANDLE *phServerGroup, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetErrorString( + /* [in] */ HRESULT dwError, + /* [in] */ LCID dwLocale, + /* [string][out] */ LPWSTR *ppString) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGroupByName( + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStatus( + /* [out] */ OPCSERVERSTATUS **ppServerStatus) = 0; + + virtual HRESULT STDMETHODCALLTYPE RemoveGroup( + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGroupEnumerator( + /* [in] */ OPCENUMSCOPE dwScope, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCServerVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCServer * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCServer * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCServer * This); + + HRESULT ( STDMETHODCALLTYPE *AddGroup )( + IOPCServer * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ BOOL bActive, + /* [in] */ DWORD dwRequestedUpdateRate, + /* [in] */ OPCHANDLE hClientGroup, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in] */ DWORD dwLCID, + /* [out] */ OPCHANDLE *phServerGroup, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + HRESULT ( STDMETHODCALLTYPE *GetErrorString )( + IOPCServer * This, + /* [in] */ HRESULT dwError, + /* [in] */ LCID dwLocale, + /* [string][out] */ LPWSTR *ppString); + + HRESULT ( STDMETHODCALLTYPE *GetGroupByName )( + IOPCServer * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + HRESULT ( STDMETHODCALLTYPE *GetStatus )( + IOPCServer * This, + /* [out] */ OPCSERVERSTATUS **ppServerStatus); + + HRESULT ( STDMETHODCALLTYPE *RemoveGroup )( + IOPCServer * This, + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce); + + HRESULT ( STDMETHODCALLTYPE *CreateGroupEnumerator )( + IOPCServer * This, + /* [in] */ OPCENUMSCOPE dwScope, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + END_INTERFACE + } IOPCServerVtbl; + + interface IOPCServer + { + CONST_VTBL struct IOPCServerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCServer_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCServer_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCServer_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCServer_AddGroup(This,szName,bActive,dwRequestedUpdateRate,hClientGroup,pTimeBias,pPercentDeadband,dwLCID,phServerGroup,pRevisedUpdateRate,riid,ppUnk) \ + (This)->lpVtbl -> AddGroup(This,szName,bActive,dwRequestedUpdateRate,hClientGroup,pTimeBias,pPercentDeadband,dwLCID,phServerGroup,pRevisedUpdateRate,riid,ppUnk) + +#define IOPCServer_GetErrorString(This,dwError,dwLocale,ppString) \ + (This)->lpVtbl -> GetErrorString(This,dwError,dwLocale,ppString) + +#define IOPCServer_GetGroupByName(This,szName,riid,ppUnk) \ + (This)->lpVtbl -> GetGroupByName(This,szName,riid,ppUnk) + +#define IOPCServer_GetStatus(This,ppServerStatus) \ + (This)->lpVtbl -> GetStatus(This,ppServerStatus) + +#define IOPCServer_RemoveGroup(This,hServerGroup,bForce) \ + (This)->lpVtbl -> RemoveGroup(This,hServerGroup,bForce) + +#define IOPCServer_CreateGroupEnumerator(This,dwScope,riid,ppUnk) \ + (This)->lpVtbl -> CreateGroupEnumerator(This,dwScope,riid,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCServer_AddGroup_Proxy( + IOPCServer * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ BOOL bActive, + /* [in] */ DWORD dwRequestedUpdateRate, + /* [in] */ OPCHANDLE hClientGroup, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in] */ DWORD dwLCID, + /* [out] */ OPCHANDLE *phServerGroup, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCServer_AddGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServer_GetErrorString_Proxy( + IOPCServer * This, + /* [in] */ HRESULT dwError, + /* [in] */ LCID dwLocale, + /* [string][out] */ LPWSTR *ppString); + + +void __RPC_STUB IOPCServer_GetErrorString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServer_GetGroupByName_Proxy( + IOPCServer * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCServer_GetGroupByName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServer_GetStatus_Proxy( + IOPCServer * This, + /* [out] */ OPCSERVERSTATUS **ppServerStatus); + + +void __RPC_STUB IOPCServer_GetStatus_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServer_RemoveGroup_Proxy( + IOPCServer * This, + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce); + + +void __RPC_STUB IOPCServer_RemoveGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServer_CreateGroupEnumerator_Proxy( + IOPCServer * This, + /* [in] */ OPCENUMSCOPE dwScope, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCServer_CreateGroupEnumerator_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCServer_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCServerPublicGroups_INTERFACE_DEFINED__ +#define __IOPCServerPublicGroups_INTERFACE_DEFINED__ + +/* interface IOPCServerPublicGroups */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCServerPublicGroups; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a4e-011e-11d0-9675-0020afd8adb3") + IOPCServerPublicGroups : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPublicGroupByName( + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + virtual HRESULT STDMETHODCALLTYPE RemovePublicGroup( + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCServerPublicGroupsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCServerPublicGroups * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCServerPublicGroups * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCServerPublicGroups * This); + + HRESULT ( STDMETHODCALLTYPE *GetPublicGroupByName )( + IOPCServerPublicGroups * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + HRESULT ( STDMETHODCALLTYPE *RemovePublicGroup )( + IOPCServerPublicGroups * This, + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce); + + END_INTERFACE + } IOPCServerPublicGroupsVtbl; + + interface IOPCServerPublicGroups + { + CONST_VTBL struct IOPCServerPublicGroupsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCServerPublicGroups_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCServerPublicGroups_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCServerPublicGroups_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCServerPublicGroups_GetPublicGroupByName(This,szName,riid,ppUnk) \ + (This)->lpVtbl -> GetPublicGroupByName(This,szName,riid,ppUnk) + +#define IOPCServerPublicGroups_RemovePublicGroup(This,hServerGroup,bForce) \ + (This)->lpVtbl -> RemovePublicGroup(This,hServerGroup,bForce) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCServerPublicGroups_GetPublicGroupByName_Proxy( + IOPCServerPublicGroups * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCServerPublicGroups_GetPublicGroupByName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServerPublicGroups_RemovePublicGroup_Proxy( + IOPCServerPublicGroups * This, + /* [in] */ OPCHANDLE hServerGroup, + /* [in] */ BOOL bForce); + + +void __RPC_STUB IOPCServerPublicGroups_RemovePublicGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCServerPublicGroups_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCBrowseServerAddressSpace_INTERFACE_DEFINED__ +#define __IOPCBrowseServerAddressSpace_INTERFACE_DEFINED__ + +/* interface IOPCBrowseServerAddressSpace */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCBrowseServerAddressSpace; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a4f-011e-11d0-9675-0020afd8adb3") + IOPCBrowseServerAddressSpace : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE QueryOrganization( + /* [out] */ OPCNAMESPACETYPE *pNameSpaceType) = 0; + + virtual HRESULT STDMETHODCALLTYPE ChangeBrowsePosition( + /* [in] */ OPCBROWSEDIRECTION dwBrowseDirection, + /* [string][in] */ LPCWSTR szString) = 0; + + virtual HRESULT STDMETHODCALLTYPE BrowseOPCItemIDs( + /* [in] */ OPCBROWSETYPE dwBrowseFilterType, + /* [string][in] */ LPCWSTR szFilterCriteria, + /* [in] */ VARTYPE vtDataTypeFilter, + /* [in] */ DWORD dwAccessRightsFilter, + /* [out] */ LPENUMSTRING *ppIEnumString) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetItemID( + /* [in] */ LPWSTR szItemDataID, + /* [string][out] */ LPWSTR *szItemID) = 0; + + virtual HRESULT STDMETHODCALLTYPE BrowseAccessPaths( + /* [string][in] */ LPCWSTR szItemID, + /* [out] */ LPENUMSTRING *ppIEnumString) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCBrowseServerAddressSpaceVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCBrowseServerAddressSpace * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCBrowseServerAddressSpace * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCBrowseServerAddressSpace * This); + + HRESULT ( STDMETHODCALLTYPE *QueryOrganization )( + IOPCBrowseServerAddressSpace * This, + /* [out] */ OPCNAMESPACETYPE *pNameSpaceType); + + HRESULT ( STDMETHODCALLTYPE *ChangeBrowsePosition )( + IOPCBrowseServerAddressSpace * This, + /* [in] */ OPCBROWSEDIRECTION dwBrowseDirection, + /* [string][in] */ LPCWSTR szString); + + HRESULT ( STDMETHODCALLTYPE *BrowseOPCItemIDs )( + IOPCBrowseServerAddressSpace * This, + /* [in] */ OPCBROWSETYPE dwBrowseFilterType, + /* [string][in] */ LPCWSTR szFilterCriteria, + /* [in] */ VARTYPE vtDataTypeFilter, + /* [in] */ DWORD dwAccessRightsFilter, + /* [out] */ LPENUMSTRING *ppIEnumString); + + HRESULT ( STDMETHODCALLTYPE *GetItemID )( + IOPCBrowseServerAddressSpace * This, + /* [in] */ LPWSTR szItemDataID, + /* [string][out] */ LPWSTR *szItemID); + + HRESULT ( STDMETHODCALLTYPE *BrowseAccessPaths )( + IOPCBrowseServerAddressSpace * This, + /* [string][in] */ LPCWSTR szItemID, + /* [out] */ LPENUMSTRING *ppIEnumString); + + END_INTERFACE + } IOPCBrowseServerAddressSpaceVtbl; + + interface IOPCBrowseServerAddressSpace + { + CONST_VTBL struct IOPCBrowseServerAddressSpaceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCBrowseServerAddressSpace_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCBrowseServerAddressSpace_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCBrowseServerAddressSpace_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCBrowseServerAddressSpace_QueryOrganization(This,pNameSpaceType) \ + (This)->lpVtbl -> QueryOrganization(This,pNameSpaceType) + +#define IOPCBrowseServerAddressSpace_ChangeBrowsePosition(This,dwBrowseDirection,szString) \ + (This)->lpVtbl -> ChangeBrowsePosition(This,dwBrowseDirection,szString) + +#define IOPCBrowseServerAddressSpace_BrowseOPCItemIDs(This,dwBrowseFilterType,szFilterCriteria,vtDataTypeFilter,dwAccessRightsFilter,ppIEnumString) \ + (This)->lpVtbl -> BrowseOPCItemIDs(This,dwBrowseFilterType,szFilterCriteria,vtDataTypeFilter,dwAccessRightsFilter,ppIEnumString) + +#define IOPCBrowseServerAddressSpace_GetItemID(This,szItemDataID,szItemID) \ + (This)->lpVtbl -> GetItemID(This,szItemDataID,szItemID) + +#define IOPCBrowseServerAddressSpace_BrowseAccessPaths(This,szItemID,ppIEnumString) \ + (This)->lpVtbl -> BrowseAccessPaths(This,szItemID,ppIEnumString) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCBrowseServerAddressSpace_QueryOrganization_Proxy( + IOPCBrowseServerAddressSpace * This, + /* [out] */ OPCNAMESPACETYPE *pNameSpaceType); + + +void __RPC_STUB IOPCBrowseServerAddressSpace_QueryOrganization_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCBrowseServerAddressSpace_ChangeBrowsePosition_Proxy( + IOPCBrowseServerAddressSpace * This, + /* [in] */ OPCBROWSEDIRECTION dwBrowseDirection, + /* [string][in] */ LPCWSTR szString); + + +void __RPC_STUB IOPCBrowseServerAddressSpace_ChangeBrowsePosition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCBrowseServerAddressSpace_BrowseOPCItemIDs_Proxy( + IOPCBrowseServerAddressSpace * This, + /* [in] */ OPCBROWSETYPE dwBrowseFilterType, + /* [string][in] */ LPCWSTR szFilterCriteria, + /* [in] */ VARTYPE vtDataTypeFilter, + /* [in] */ DWORD dwAccessRightsFilter, + /* [out] */ LPENUMSTRING *ppIEnumString); + + +void __RPC_STUB IOPCBrowseServerAddressSpace_BrowseOPCItemIDs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCBrowseServerAddressSpace_GetItemID_Proxy( + IOPCBrowseServerAddressSpace * This, + /* [in] */ LPWSTR szItemDataID, + /* [string][out] */ LPWSTR *szItemID); + + +void __RPC_STUB IOPCBrowseServerAddressSpace_GetItemID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCBrowseServerAddressSpace_BrowseAccessPaths_Proxy( + IOPCBrowseServerAddressSpace * This, + /* [string][in] */ LPCWSTR szItemID, + /* [out] */ LPENUMSTRING *ppIEnumString); + + +void __RPC_STUB IOPCBrowseServerAddressSpace_BrowseAccessPaths_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCBrowseServerAddressSpace_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCGroupStateMgt_INTERFACE_DEFINED__ +#define __IOPCGroupStateMgt_INTERFACE_DEFINED__ + +/* interface IOPCGroupStateMgt */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCGroupStateMgt; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a50-011e-11d0-9675-0020afd8adb3") + IOPCGroupStateMgt : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetState( + /* [out] */ DWORD *pUpdateRate, + /* [out] */ BOOL *pActive, + /* [string][out] */ LPWSTR *ppName, + /* [out] */ LONG *pTimeBias, + /* [out] */ FLOAT *pPercentDeadband, + /* [out] */ DWORD *pLCID, + /* [out] */ OPCHANDLE *phClientGroup, + /* [out] */ OPCHANDLE *phServerGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetState( + /* [in][unique] */ DWORD *pRequestedUpdateRate, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in][unique] */ BOOL *pActive, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in][unique] */ DWORD *pLCID, + /* [in][unique] */ OPCHANDLE *phClientGroup) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetName( + /* [string][in] */ LPCWSTR szName) = 0; + + virtual HRESULT STDMETHODCALLTYPE CloneGroup( + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCGroupStateMgtVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCGroupStateMgt * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCGroupStateMgt * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCGroupStateMgt * This); + + HRESULT ( STDMETHODCALLTYPE *GetState )( + IOPCGroupStateMgt * This, + /* [out] */ DWORD *pUpdateRate, + /* [out] */ BOOL *pActive, + /* [string][out] */ LPWSTR *ppName, + /* [out] */ LONG *pTimeBias, + /* [out] */ FLOAT *pPercentDeadband, + /* [out] */ DWORD *pLCID, + /* [out] */ OPCHANDLE *phClientGroup, + /* [out] */ OPCHANDLE *phServerGroup); + + HRESULT ( STDMETHODCALLTYPE *SetState )( + IOPCGroupStateMgt * This, + /* [in][unique] */ DWORD *pRequestedUpdateRate, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in][unique] */ BOOL *pActive, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in][unique] */ DWORD *pLCID, + /* [in][unique] */ OPCHANDLE *phClientGroup); + + HRESULT ( STDMETHODCALLTYPE *SetName )( + IOPCGroupStateMgt * This, + /* [string][in] */ LPCWSTR szName); + + HRESULT ( STDMETHODCALLTYPE *CloneGroup )( + IOPCGroupStateMgt * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + END_INTERFACE + } IOPCGroupStateMgtVtbl; + + interface IOPCGroupStateMgt + { + CONST_VTBL struct IOPCGroupStateMgtVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCGroupStateMgt_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCGroupStateMgt_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCGroupStateMgt_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCGroupStateMgt_GetState(This,pUpdateRate,pActive,ppName,pTimeBias,pPercentDeadband,pLCID,phClientGroup,phServerGroup) \ + (This)->lpVtbl -> GetState(This,pUpdateRate,pActive,ppName,pTimeBias,pPercentDeadband,pLCID,phClientGroup,phServerGroup) + +#define IOPCGroupStateMgt_SetState(This,pRequestedUpdateRate,pRevisedUpdateRate,pActive,pTimeBias,pPercentDeadband,pLCID,phClientGroup) \ + (This)->lpVtbl -> SetState(This,pRequestedUpdateRate,pRevisedUpdateRate,pActive,pTimeBias,pPercentDeadband,pLCID,phClientGroup) + +#define IOPCGroupStateMgt_SetName(This,szName) \ + (This)->lpVtbl -> SetName(This,szName) + +#define IOPCGroupStateMgt_CloneGroup(This,szName,riid,ppUnk) \ + (This)->lpVtbl -> CloneGroup(This,szName,riid,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCGroupStateMgt_GetState_Proxy( + IOPCGroupStateMgt * This, + /* [out] */ DWORD *pUpdateRate, + /* [out] */ BOOL *pActive, + /* [string][out] */ LPWSTR *ppName, + /* [out] */ LONG *pTimeBias, + /* [out] */ FLOAT *pPercentDeadband, + /* [out] */ DWORD *pLCID, + /* [out] */ OPCHANDLE *phClientGroup, + /* [out] */ OPCHANDLE *phServerGroup); + + +void __RPC_STUB IOPCGroupStateMgt_GetState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCGroupStateMgt_SetState_Proxy( + IOPCGroupStateMgt * This, + /* [in][unique] */ DWORD *pRequestedUpdateRate, + /* [out] */ DWORD *pRevisedUpdateRate, + /* [in][unique] */ BOOL *pActive, + /* [in][unique] */ LONG *pTimeBias, + /* [in][unique] */ FLOAT *pPercentDeadband, + /* [in][unique] */ DWORD *pLCID, + /* [in][unique] */ OPCHANDLE *phClientGroup); + + +void __RPC_STUB IOPCGroupStateMgt_SetState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCGroupStateMgt_SetName_Proxy( + IOPCGroupStateMgt * This, + /* [string][in] */ LPCWSTR szName); + + +void __RPC_STUB IOPCGroupStateMgt_SetName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCGroupStateMgt_CloneGroup_Proxy( + IOPCGroupStateMgt * This, + /* [string][in] */ LPCWSTR szName, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCGroupStateMgt_CloneGroup_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCGroupStateMgt_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCPublicGroupStateMgt_INTERFACE_DEFINED__ +#define __IOPCPublicGroupStateMgt_INTERFACE_DEFINED__ + +/* interface IOPCPublicGroupStateMgt */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCPublicGroupStateMgt; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a51-011e-11d0-9675-0020afd8adb3") + IOPCPublicGroupStateMgt : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetState( + /* [out] */ BOOL *pPublic) = 0; + + virtual HRESULT STDMETHODCALLTYPE MoveToPublic( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCPublicGroupStateMgtVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCPublicGroupStateMgt * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCPublicGroupStateMgt * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCPublicGroupStateMgt * This); + + HRESULT ( STDMETHODCALLTYPE *GetState )( + IOPCPublicGroupStateMgt * This, + /* [out] */ BOOL *pPublic); + + HRESULT ( STDMETHODCALLTYPE *MoveToPublic )( + IOPCPublicGroupStateMgt * This); + + END_INTERFACE + } IOPCPublicGroupStateMgtVtbl; + + interface IOPCPublicGroupStateMgt + { + CONST_VTBL struct IOPCPublicGroupStateMgtVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCPublicGroupStateMgt_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCPublicGroupStateMgt_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCPublicGroupStateMgt_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCPublicGroupStateMgt_GetState(This,pPublic) \ + (This)->lpVtbl -> GetState(This,pPublic) + +#define IOPCPublicGroupStateMgt_MoveToPublic(This) \ + (This)->lpVtbl -> MoveToPublic(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCPublicGroupStateMgt_GetState_Proxy( + IOPCPublicGroupStateMgt * This, + /* [out] */ BOOL *pPublic); + + +void __RPC_STUB IOPCPublicGroupStateMgt_GetState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCPublicGroupStateMgt_MoveToPublic_Proxy( + IOPCPublicGroupStateMgt * This); + + +void __RPC_STUB IOPCPublicGroupStateMgt_MoveToPublic_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCPublicGroupStateMgt_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCSyncIO_INTERFACE_DEFINED__ +#define __IOPCSyncIO_INTERFACE_DEFINED__ + +/* interface IOPCSyncIO */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCSyncIO; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a52-011e-11d0-9675-0020afd8adb3") + IOPCSyncIO : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Read( + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ OPCITEMSTATE **ppItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE Write( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCSyncIOVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCSyncIO * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCSyncIO * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCSyncIO * This); + + HRESULT ( STDMETHODCALLTYPE *Read )( + IOPCSyncIO * This, + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ OPCITEMSTATE **ppItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *Write )( + IOPCSyncIO * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + END_INTERFACE + } IOPCSyncIOVtbl; + + interface IOPCSyncIO + { + CONST_VTBL struct IOPCSyncIOVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCSyncIO_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCSyncIO_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCSyncIO_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCSyncIO_Read(This,dwSource,dwNumItems,phServer,ppItemValues,ppErrors) \ + (This)->lpVtbl -> Read(This,dwSource,dwNumItems,phServer,ppItemValues,ppErrors) + +#define IOPCSyncIO_Write(This,dwNumItems,phServer,pItemValues,ppErrors) \ + (This)->lpVtbl -> Write(This,dwNumItems,phServer,pItemValues,ppErrors) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCSyncIO_Read_Proxy( + IOPCSyncIO * This, + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ OPCITEMSTATE **ppItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCSyncIO_Read_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCSyncIO_Write_Proxy( + IOPCSyncIO * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCSyncIO_Write_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCSyncIO_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCAsyncIO_INTERFACE_DEFINED__ +#define __IOPCAsyncIO_INTERFACE_DEFINED__ + +/* interface IOPCAsyncIO */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCAsyncIO; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a53-011e-11d0-9675-0020afd8adb3") + IOPCAsyncIO : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Read( + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE Write( + /* [in] */ DWORD dwConnection, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE Refresh( + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [out] */ DWORD *pTransactionID) = 0; + + virtual HRESULT STDMETHODCALLTYPE Cancel( + /* [in] */ DWORD dwTransactionID) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCAsyncIOVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCAsyncIO * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCAsyncIO * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCAsyncIO * This); + + HRESULT ( STDMETHODCALLTYPE *Read )( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *Write )( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *Refresh )( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [out] */ DWORD *pTransactionID); + + HRESULT ( STDMETHODCALLTYPE *Cancel )( + IOPCAsyncIO * This, + /* [in] */ DWORD dwTransactionID); + + END_INTERFACE + } IOPCAsyncIOVtbl; + + interface IOPCAsyncIO + { + CONST_VTBL struct IOPCAsyncIOVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCAsyncIO_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCAsyncIO_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCAsyncIO_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCAsyncIO_Read(This,dwConnection,dwSource,dwNumItems,phServer,pTransactionID,ppErrors) \ + (This)->lpVtbl -> Read(This,dwConnection,dwSource,dwNumItems,phServer,pTransactionID,ppErrors) + +#define IOPCAsyncIO_Write(This,dwConnection,dwNumItems,phServer,pItemValues,pTransactionID,ppErrors) \ + (This)->lpVtbl -> Write(This,dwConnection,dwNumItems,phServer,pItemValues,pTransactionID,ppErrors) + +#define IOPCAsyncIO_Refresh(This,dwConnection,dwSource,pTransactionID) \ + (This)->lpVtbl -> Refresh(This,dwConnection,dwSource,pTransactionID) + +#define IOPCAsyncIO_Cancel(This,dwTransactionID) \ + (This)->lpVtbl -> Cancel(This,dwTransactionID) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Read_Proxy( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCAsyncIO_Read_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Write_Proxy( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARIANT *pItemValues, + /* [out] */ DWORD *pTransactionID, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCAsyncIO_Write_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Refresh_Proxy( + IOPCAsyncIO * This, + /* [in] */ DWORD dwConnection, + /* [in] */ OPCDATASOURCE dwSource, + /* [out] */ DWORD *pTransactionID); + + +void __RPC_STUB IOPCAsyncIO_Refresh_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Cancel_Proxy( + IOPCAsyncIO * This, + /* [in] */ DWORD dwTransactionID); + + +void __RPC_STUB IOPCAsyncIO_Cancel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCAsyncIO_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCItemMgt_INTERFACE_DEFINED__ +#define __IOPCItemMgt_INTERFACE_DEFINED__ + +/* interface IOPCItemMgt */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCItemMgt; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a54-011e-11d0-9675-0020afd8adb3") + IOPCItemMgt : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE AddItems( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppAddResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE ValidateItems( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [in] */ BOOL bBlobUpdate, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppValidationResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE RemoveItems( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetActiveState( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [in] */ BOOL bActive, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetClientHandles( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ OPCHANDLE *phClient, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDatatypes( + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARTYPE *pRequestedDatatypes, + /* [size_is][size_is][out] */ HRESULT **ppErrors) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateEnumerator( + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCItemMgtVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCItemMgt * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCItemMgt * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCItemMgt * This); + + HRESULT ( STDMETHODCALLTYPE *AddItems )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppAddResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *ValidateItems )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [in] */ BOOL bBlobUpdate, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppValidationResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *RemoveItems )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *SetActiveState )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [in] */ BOOL bActive, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *SetClientHandles )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ OPCHANDLE *phClient, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *SetDatatypes )( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARTYPE *pRequestedDatatypes, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + HRESULT ( STDMETHODCALLTYPE *CreateEnumerator )( + IOPCItemMgt * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + END_INTERFACE + } IOPCItemMgtVtbl; + + interface IOPCItemMgt + { + CONST_VTBL struct IOPCItemMgtVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCItemMgt_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCItemMgt_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCItemMgt_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCItemMgt_AddItems(This,dwNumItems,pItemArray,ppAddResults,ppErrors) \ + (This)->lpVtbl -> AddItems(This,dwNumItems,pItemArray,ppAddResults,ppErrors) + +#define IOPCItemMgt_ValidateItems(This,dwNumItems,pItemArray,bBlobUpdate,ppValidationResults,ppErrors) \ + (This)->lpVtbl -> ValidateItems(This,dwNumItems,pItemArray,bBlobUpdate,ppValidationResults,ppErrors) + +#define IOPCItemMgt_RemoveItems(This,dwNumItems,phServer,ppErrors) \ + (This)->lpVtbl -> RemoveItems(This,dwNumItems,phServer,ppErrors) + +#define IOPCItemMgt_SetActiveState(This,dwNumItems,phServer,bActive,ppErrors) \ + (This)->lpVtbl -> SetActiveState(This,dwNumItems,phServer,bActive,ppErrors) + +#define IOPCItemMgt_SetClientHandles(This,dwNumItems,phServer,phClient,ppErrors) \ + (This)->lpVtbl -> SetClientHandles(This,dwNumItems,phServer,phClient,ppErrors) + +#define IOPCItemMgt_SetDatatypes(This,dwNumItems,phServer,pRequestedDatatypes,ppErrors) \ + (This)->lpVtbl -> SetDatatypes(This,dwNumItems,phServer,pRequestedDatatypes,ppErrors) + +#define IOPCItemMgt_CreateEnumerator(This,riid,ppUnk) \ + (This)->lpVtbl -> CreateEnumerator(This,riid,ppUnk) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_AddItems_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppAddResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_AddItems_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_ValidateItems_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCITEMDEF *pItemArray, + /* [in] */ BOOL bBlobUpdate, + /* [size_is][size_is][out] */ OPCITEMRESULT **ppValidationResults, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_ValidateItems_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_RemoveItems_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_RemoveItems_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_SetActiveState_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [in] */ BOOL bActive, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_SetActiveState_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_SetClientHandles_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ OPCHANDLE *phClient, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_SetClientHandles_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_SetDatatypes_Proxy( + IOPCItemMgt * This, + /* [in] */ DWORD dwNumItems, + /* [size_is][in] */ OPCHANDLE *phServer, + /* [size_is][in] */ VARTYPE *pRequestedDatatypes, + /* [size_is][size_is][out] */ HRESULT **ppErrors); + + +void __RPC_STUB IOPCItemMgt_SetDatatypes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCItemMgt_CreateEnumerator_Proxy( + IOPCItemMgt * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ LPUNKNOWN *ppUnk); + + +void __RPC_STUB IOPCItemMgt_CreateEnumerator_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCItemMgt_INTERFACE_DEFINED__ */ + + +#ifndef __IEnumOPCItemAttributes_INTERFACE_DEFINED__ +#define __IEnumOPCItemAttributes_INTERFACE_DEFINED__ + +/* interface IEnumOPCItemAttributes */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IEnumOPCItemAttributes; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("39c13a55-011e-11d0-9675-0020afd8adb3") + IEnumOPCItemAttributes : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [size_is][size_is][out] */ OPCITEMATTRIBUTES **ppItemArray, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IEnumOPCItemAttributes **ppEnumItemAttributes) = 0; + + }; + +#else /* C style interface */ + + typedef struct IEnumOPCItemAttributesVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IEnumOPCItemAttributes * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IEnumOPCItemAttributes * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IEnumOPCItemAttributes * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IEnumOPCItemAttributes * This, + /* [in] */ ULONG celt, + /* [size_is][size_is][out] */ OPCITEMATTRIBUTES **ppItemArray, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IEnumOPCItemAttributes * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IEnumOPCItemAttributes * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IEnumOPCItemAttributes * This, + /* [out] */ IEnumOPCItemAttributes **ppEnumItemAttributes); + + END_INTERFACE + } IEnumOPCItemAttributesVtbl; + + interface IEnumOPCItemAttributes + { + CONST_VTBL struct IEnumOPCItemAttributesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IEnumOPCItemAttributes_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IEnumOPCItemAttributes_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IEnumOPCItemAttributes_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IEnumOPCItemAttributes_Next(This,celt,ppItemArray,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,ppItemArray,pceltFetched) + +#define IEnumOPCItemAttributes_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IEnumOPCItemAttributes_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IEnumOPCItemAttributes_Clone(This,ppEnumItemAttributes) \ + (This)->lpVtbl -> Clone(This,ppEnumItemAttributes) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IEnumOPCItemAttributes_Next_Proxy( + IEnumOPCItemAttributes * This, + /* [in] */ ULONG celt, + /* [size_is][size_is][out] */ OPCITEMATTRIBUTES **ppItemArray, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IEnumOPCItemAttributes_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumOPCItemAttributes_Skip_Proxy( + IEnumOPCItemAttributes * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IEnumOPCItemAttributes_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumOPCItemAttributes_Reset_Proxy( + IEnumOPCItemAttributes * This); + + +void __RPC_STUB IEnumOPCItemAttributes_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IEnumOPCItemAttributes_Clone_Proxy( + IEnumOPCItemAttributes * This, + /* [out] */ IEnumOPCItemAttributes **ppEnumItemAttributes); + + +void __RPC_STUB IEnumOPCItemAttributes_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IEnumOPCItemAttributes_INTERFACE_DEFINED__ */ + + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/opc/opc_ae.idl b/opc/opc_ae.idl new file mode 100644 index 0000000..f437603 --- /dev/null +++ b/opc/opc_ae.idl @@ -0,0 +1,506 @@ +//============================================================================== +// TITLE: opc_ae.idl +// +// CONTENTS: +// +// Interface declarations for the OPC Alarms & Event specifications. +// +// (c) Copyright 1997-2003 The OPC Foundation +// ALL RIGHTS RESERVED. +// +// DISCLAIMER: +// This code is provided by the OPC Foundation solely to assist in +// understanding and use of the appropriate OPC Specification(s) and may be +// used as set forth in the License Grant section of the OPC Specification. +// This code is provided as-is and without warranty or support of any sort +// and is subject to the Warranty and Liability Disclaimers which appear +// in the printed OPC Specification. +// +// MODIFICATION LOG: +// +// Date By Notes +// ---------- --- ----- +// 2002/10/02 JL Updated for Version 1.1. +// 2003/01/06 RSA Fixed formatting to comply with coding guidelines. +// 2004/09/01 RSA Renamed modules in TYPELIB section to avoid name conflicts. +// + +import "oaidl.idl"; +import "ocidl.idl"; + +//============================================================================== +// Category ID declaration (defined as an interface to ensure they show up in the typelib). + +[uuid(58E13251-AC87-11d1-84D5-00608CB8A7E9)] interface OPCEventServerCATID : IUnknown {} + +cpp_quote("#define CATID_OPCAEServer10 IID_OPCEventServerCATID") + +//============================================================================== +// Structures, Typedefs and Enumerations. + +typedef DWORD OPCHANDLE; + +typedef enum +{ + OPCAE_BROWSE_UP = 1, + OPCAE_BROWSE_DOWN, + OPCAE_BROWSE_TO +} +OPCAEBROWSEDIRECTION; + +typedef enum +{ + OPC_AREA = 1, + OPC_SOURCE +} +OPCAEBROWSETYPE; + +typedef enum +{ + OPCAE_STATUS_RUNNING = 1, + OPCAE_STATUS_FAILED, + OPCAE_STATUS_NOCONFIG, + OPCAE_STATUS_SUSPENDED, + OPCAE_STATUS_TEST, + OPCAE_STATUS_COMM_FAULT +} +OPCEVENTSERVERSTATE; + +typedef struct +{ + WORD wChangeMask; + WORD wNewState; + [string] LPWSTR szSource; + FILETIME ftTime; + [string] LPWSTR szMessage; + DWORD dwEventType; + DWORD dwEventCategory; + DWORD dwSeverity; + [string] LPWSTR szConditionName; + [string] LPWSTR szSubconditionName; + WORD wQuality; + WORD wReserved; + BOOL bAckRequired; + FILETIME ftActiveTime; + DWORD dwCookie; + DWORD dwNumEventAttrs; + [size_is(dwNumEventAttrs)] VARIANT* pEventAttributes; + [string] LPWSTR szActorID; +} +ONEVENTSTRUCT; + +typedef struct +{ + FILETIME ftStartTime; + FILETIME ftCurrentTime; + FILETIME ftLastUpdateTime; + OPCEVENTSERVERSTATE dwServerState; + WORD wMajorVersion; + WORD wMinorVersion; + WORD wBuildNumber; + WORD wReserved; + [string] LPWSTR szVendorInfo; +} +OPCEVENTSERVERSTATUS; + +typedef struct +{ + WORD wState; + WORD wReserved1; + LPWSTR szActiveSubCondition; + LPWSTR szASCDefinition; + DWORD dwASCSeverity; + LPWSTR szASCDescription; + WORD wQuality; + WORD wReserved2; + FILETIME ftLastAckTime; + FILETIME ftSubCondLastActive; + FILETIME ftCondLastActive; + FILETIME ftCondLastInactive; + LPWSTR szAcknowledgerID; + LPWSTR szComment; + DWORD dwNumSCs; + [size_is (dwNumSCs)] LPWSTR * pszSCNames; + [size_is (dwNumSCs)] LPWSTR * pszSCDefinitions; + [size_is (dwNumSCs)] DWORD * pdwSCSeverities; + [size_is (dwNumSCs)] LPWSTR * pszSCDescriptions; + DWORD dwNumEventAttrs; + [size_is(dwNumEventAttrs)] VARIANT* pEventAttributes; + [size_is(dwNumEventAttrs)] HRESULT* pErrors; +} +OPCCONDITIONSTATE; + +//============================================================================== +// IOPCEventServer + +[ + uuid(65168851-5783-11D1-84A0-00608CB8A7E9), + pointer_default(unique) +] +interface IOPCEventServer : IUnknown +{ + HRESULT GetStatus( + [out] OPCEVENTSERVERSTATUS **ppEventServerStatus + ); + + HRESULT CreateEventSubscription( + [in] BOOL bActive, + [in] DWORD dwBufferTime, + [in] DWORD dwMaxSize, + [in] OPCHANDLE hClientSubscription, + [in] REFIID riid, + [out, iid_is(riid)] LPUNKNOWN* ppUnk, + [out] DWORD* pdwRevisedBufferTime, + [out] DWORD* pdwRevisedMaxSize + ); + + HRESULT QueryAvailableFilters( + [out] DWORD* pdwFilterMask + ); + + HRESULT QueryEventCategories( + [in] DWORD dwEventType, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] DWORD** ppdwEventCategories, + [out, size_is(,*pdwCount)] LPWSTR** ppszEventCategoryDescs + ); + + HRESULT QueryConditionNames( + [in] DWORD dwEventCategory, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] LPWSTR** ppszConditionNames + ); + + HRESULT QuerySubConditionNames( + [in] LPWSTR szConditionName, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] LPWSTR** ppszSubConditionNames + ); + + HRESULT QuerySourceConditions( + [in] LPWSTR szSource, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] LPWSTR** ppszConditionNames + ); + + HRESULT QueryEventAttributes( + [in] DWORD dwEventCategory, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] DWORD** ppdwAttrIDs, + [out, size_is(,*pdwCount)] LPWSTR** ppszAttrDescs, + [out, size_is(,*pdwCount)] VARTYPE** ppvtAttrTypes + ); + + HRESULT TranslateToItemIDs( + [in] LPWSTR szSource, + [in] DWORD dwEventCategory, + [in] LPWSTR szConditionName, + [in] LPWSTR szSubconditionName, + [in] DWORD dwCount, + [in, size_is(dwCount)] DWORD* pdwAssocAttrIDs, + [out, size_is(,dwCount)] LPWSTR** ppszAttrItemIDs, + [out, size_is(,dwCount)] LPWSTR** ppszNodeNames, + [out, size_is(,dwCount)] CLSID** ppCLSIDs + ); + + HRESULT GetConditionState ( + [in] LPWSTR szSource, + [in] LPWSTR szConditionName, + [in] DWORD dwNumEventAttrs, + [in, size_is(dwNumEventAttrs)] DWORD* pdwAttributeIDs, + [out] OPCCONDITIONSTATE** ppConditionState + ); + + HRESULT EnableConditionByArea( + [in] DWORD dwNumAreas, + [in, size_is(dwNumAreas)] LPWSTR* pszAreas + ); + + + HRESULT EnableConditionBySource( + [in] DWORD dwNumSources, + [in, size_is(dwNumSources)] LPWSTR* pszSources + ); + + HRESULT DisableConditionByArea( + [in] DWORD dwNumAreas, + [in, size_is(dwNumAreas)] LPWSTR* pszAreas + ); + + HRESULT DisableConditionBySource( + [in] DWORD dwNumSources, + [in, size_is(dwNumSources)] LPWSTR* pszSources + ); + + HRESULT AckCondition( + [in] DWORD dwCount, + [in, string] LPWSTR szAcknowledgerID, + [in, string] LPWSTR szComment, + [in, size_is(dwCount)] LPWSTR* pszSource, + [in, size_is(dwCount)] LPWSTR* pszConditionName, + [in, size_is(dwCount)] FILETIME* pftActiveTime, + [in, size_is(dwCount)] DWORD* pdwCookie, + [out, size_is(,dwCount)] HRESULT** ppErrors + ); + + HRESULT CreateAreaBrowser( + [in] REFIID riid, + [out, iid_is(riid)] LPUNKNOWN* ppUnk + ); +}; + +//============================================================================== +// IOPCEventSubscriptionMgt + +[ + uuid(65168855-5783-11D1-84A0-00608CB8A7E9), + pointer_default(unique) +] +interface IOPCEventSubscriptionMgt : IUnknown +{ + HRESULT SetFilter( + [in] DWORD dwEventType, + [in] DWORD dwNumCategories, + [in, size_is(dwNumCategories)] DWORD* pdwEventCategories, + [in] DWORD dwLowSeverity, + [in] DWORD dwHighSeverity, + [in] DWORD dwNumAreas, + [in, size_is(dwNumAreas)] LPWSTR* pszAreaList, + [in] DWORD dwNumSources, + [in, size_is(dwNumSources)] LPWSTR* pszSourceList + ); + + HRESULT GetFilter( + [out] DWORD* pdwEventType, + [out] DWORD* pdwNumCategories, + [out, size_is(,*pdwNumCategories)] DWORD** ppdwEventCategories, + [out] DWORD* pdwLowSeverity, + [out] DWORD* pdwHighSeverity, + [out] DWORD* pdwNumAreas, + [out, size_is(,*pdwNumAreas)] LPWSTR** ppszAreaList, + [out] DWORD* pdwNumSources, + [out, size_is(,*pdwNumSources)] LPWSTR** ppszSourceList + ); + + HRESULT SelectReturnedAttributes( + [in] DWORD dwEventCategory, + [in] DWORD dwCount, + [in, size_is(dwCount)] DWORD* dwAttributeIDs + ); + + HRESULT GetReturnedAttributes( + [in] DWORD dwEventCategory, + [out] DWORD* pdwCount, + [out, size_is(,*pdwCount)] DWORD** ppdwAttributeIDs + ); + + + HRESULT Refresh( + [in] DWORD dwConnection + ); + + HRESULT CancelRefresh( + [in] DWORD dwConnection + ); + + HRESULT GetState( + [out] BOOL* pbActive, + [out] DWORD* pdwBufferTime, + [out] DWORD* pdwMaxSize, + [out] OPCHANDLE* phClientSubscription + ); + + HRESULT SetState( + [unique, in] BOOL* pbActive, + [unique, in] DWORD* pdwBufferTime, + [unique, in] DWORD* pdwMaxSize, + [in] OPCHANDLE hClientSubscription, + [out] DWORD* pdwRevisedBufferTime, + [out] DWORD* pdwRevisedMaxSize + ); +}; + +//============================================================================== +// IOPCEventAreaBrowser + +[ + uuid(65168857-5783-11D1-84A0-00608CB8A7E9), + pointer_default(unique) +] +interface IOPCEventAreaBrowser : IUnknown +{ + HRESULT ChangeBrowsePosition( + [in] OPCAEBROWSEDIRECTION dwBrowseDirection, + [in, string] LPCWSTR szString + ); + + HRESULT BrowseOPCAreas( + [in] OPCAEBROWSETYPE dwBrowseFilterType, + [in, string] LPCWSTR szFilterCriteria, + [out] LPENUMSTRING* ppIEnumString + ); + + HRESULT GetQualifiedAreaName( + [in] LPCWSTR szAreaName, + [out, string] LPWSTR* pszQualifiedAreaName + ); + + HRESULT GetQualifiedSourceName( + [in] LPCWSTR szSourceName, + [out, string] LPWSTR* pszQualifiedSourceName + ); +}; + +//============================================================================== +// IOPCEventSink + +[ + uuid(6516885F-5783-11D1-84A0-00608CB8A7E9), + pointer_default(unique) +] +interface IOPCEventSink : IUnknown +{ + HRESULT OnEvent( + [in] OPCHANDLE hClientSubscription, + [in] BOOL bRefresh, + [in] BOOL bLastRefresh, + [in] DWORD dwCount, + [in, size_is(dwCount)] ONEVENTSTRUCT* pEvents + ); +}; + +//============================================================================== +// IOPCEventServer2 + +[ + uuid(71BBE88E-9564-4bcd-BCFC-71C558D94F2D), + pointer_default(unique) +] +interface IOPCEventServer2 : IOPCEventServer +{ + HRESULT EnableConditionByArea2( + [in] DWORD dwNumAreas, + [in, string, size_is(dwNumAreas)] LPWSTR* pszAreas, + [out, size_is(,dwNumAreas)] HRESULT** ppErrors + ); + + HRESULT EnableConditionBySource2( + [in] DWORD dwNumSources, + [in, string, size_is(dwNumSources)] LPWSTR* pszSources, + [out, size_is(,dwNumSources)] HRESULT** ppErrors + ); + + HRESULT DisableConditionByArea2( + [in] DWORD dwNumAreas, + [in, string, size_is(dwNumAreas)] LPWSTR* pszAreas, + [out, size_is(,dwNumAreas)] HRESULT** ppErrors + ); + + HRESULT DisableConditionBySource2( + [in] DWORD dwNumSources, + [in, string, size_is(dwNumSources)] LPWSTR* pszSources, + [out, size_is(,dwNumSources)] HRESULT** ppErrors + ); + + HRESULT GetEnableStateByArea( + [in] DWORD dwNumAreas, + [in, string, size_is(dwNumAreas)] LPWSTR* pszAreas, + [out, size_is(,dwNumAreas)] BOOL** pbEnabled, + [out, size_is(,dwNumAreas)] BOOL** pbEffectivelyEnabled, + [out, size_is(,dwNumAreas)] HRESULT** ppErrors + ); + + HRESULT GetEnableStateBySource( + [in] DWORD dwNumSources, + [in, string, size_is(dwNumSources)] LPWSTR* pszSources, + [out, size_is(,dwNumSources)] BOOL** pbEnabled, + [out, size_is(,dwNumSources)] BOOL** pbEffectivelyEnabled, + [out, size_is(,dwNumSources)] HRESULT** ppErrors + ); +}; + +//============================================================================== +// IOPCEventSubscriptionMgt2 + +[ + uuid(94C955DC-3684-4ccb-AFAB-F898CE19AAC3), + pointer_default(unique) +] +interface IOPCEventSubscriptionMgt2 : IOPCEventSubscriptionMgt +{ + HRESULT SetKeepAlive( + [in] DWORD dwKeepAliveTime, + [out] DWORD* pdwRevisedKeepAliveTime + ); + + HRESULT GetKeepAlive( + [out] DWORD* pdwKeepAliveTime + ); +}; + +//============================================================================== +// Type Library + +[ + uuid(65168844-5783-11D1-84A0-00608CB8A7E9), + version(1.10), + helpstring("OPC Alarms & Events 1.10 Type Library") +] +library OPC_AE +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + //========================================================================== + // Category IDs + + interface OPCEventServerCATID; + + //========================================================================== + // Constants + + module OPCAE_Constants + { + // category description string. + const LPCWSTR OPC_CATEGORY_DESCRIPTION_AE10 = L"OPC Alarm & Event Server Version 1.0"; + + // state bit masks. + const DWORD OPC_CONDITION_ENABLED = 0x0001; + const DWORD OPC_CONDITION_ACTIVE = 0x0002; + const DWORD OPC_CONDITION_ACKED = 0x0004; + + // bit masks for change mask. + const DWORD OPC_CHANGE_ACTIVE_STATE = 0x0001; + const DWORD OPC_CHANGE_ACK_STATE = 0x0002; + const DWORD OPC_CHANGE_ENABLE_STATE = 0x0004; + const DWORD OPC_CHANGE_QUALITY = 0x0008; + const DWORD OPC_CHANGE_SEVERITY = 0x0010; + const DWORD OPC_CHANGE_SUBCONDITION = 0x0020; + const DWORD OPC_CHANGE_MESSAGE = 0x0040; + const DWORD OPC_CHANGE_ATTRIBUTE = 0x0080; + + // event type. + const DWORD OPC_SIMPLE_EVENT = 0x0001; + const DWORD OPC_TRACKING_EVENT = 0x0002; + const DWORD OPC_CONDITION_EVENT = 0x0004; + const DWORD OPC_ALL_EVENTS = 0x0007; + + // bit masks for QueryAvailableFilters(). + const DWORD OPC_FILTER_BY_EVENT = 0x0001; + const DWORD OPC_FILTER_BY_CATEGORY = 0x0002; + const DWORD OPC_FILTER_BY_SEVERITY = 0x0004; + const DWORD OPC_FILTER_BY_AREA = 0x0008; + const DWORD OPC_FILTER_BY_SOURCE = 0x0010; + } + + //========================================================================== + // Synchronous Interfaces + + interface IOPCEventServer; + interface IOPCEventSubscriptionMgt; + interface IOPCEventAreaBrowser; + interface IOPCEventSink; + interface OPCEventServerCATID; + interface IOPCEventServer2; + interface IOPCEventSubscriptionMgt2; +}; diff --git a/opc/opc_i.c b/opc/opc_i.c new file mode 100644 index 0000000..efcc64c --- /dev/null +++ b/opc/opc_i.c @@ -0,0 +1,103 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* at Fri May 07 13:13:29 2010 + */ +/* Compiler settings for opc.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_IOPCServer,0x39c13a4d,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCServerPublicGroups,0x39c13a4e,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCBrowseServerAddressSpace,0x39c13a4f,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCGroupStateMgt,0x39c13a50,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCPublicGroupStateMgt,0x39c13a51,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCSyncIO,0x39c13a52,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCAsyncIO,0x39c13a53,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IOPCItemMgt,0x39c13a54,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + + +MIDL_DEFINE_GUID(IID, IID_IEnumOPCItemAttributes,0x39c13a55,0x011e,0x11d0,0x96,0x75,0x00,0x20,0xaf,0xd8,0xad,0xb3); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + diff --git a/opc/opccomn.h b/opc/opccomn.h new file mode 100644 index 0000000..2fd695c --- /dev/null +++ b/opc/opccomn.h @@ -0,0 +1,899 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* at Fri Nov 25 09:10:36 2005 + */ +/* Compiler settings for .\opccomn.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __opccomn_h__ +#define __opccomn_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IOPCShutdown_FWD_DEFINED__ +#define __IOPCShutdown_FWD_DEFINED__ +typedef interface IOPCShutdown IOPCShutdown; +#endif /* __IOPCShutdown_FWD_DEFINED__ */ + + +#ifndef __IOPCCommon_FWD_DEFINED__ +#define __IOPCCommon_FWD_DEFINED__ +typedef interface IOPCCommon IOPCCommon; +#endif /* __IOPCCommon_FWD_DEFINED__ */ + + +#ifndef __IOPCServerList_FWD_DEFINED__ +#define __IOPCServerList_FWD_DEFINED__ +typedef interface IOPCServerList IOPCServerList; +#endif /* __IOPCServerList_FWD_DEFINED__ */ + + +#ifndef __IOPCEnumGUID_FWD_DEFINED__ +#define __IOPCEnumGUID_FWD_DEFINED__ +typedef interface IOPCEnumGUID IOPCEnumGUID; +#endif /* __IOPCEnumGUID_FWD_DEFINED__ */ + + +#ifndef __IOPCServerList2_FWD_DEFINED__ +#define __IOPCServerList2_FWD_DEFINED__ +typedef interface IOPCServerList2 IOPCServerList2; +#endif /* __IOPCServerList2_FWD_DEFINED__ */ + + +#ifndef __IOPCCommon_FWD_DEFINED__ +#define __IOPCCommon_FWD_DEFINED__ +typedef interface IOPCCommon IOPCCommon; +#endif /* __IOPCCommon_FWD_DEFINED__ */ + + +#ifndef __IOPCShutdown_FWD_DEFINED__ +#define __IOPCShutdown_FWD_DEFINED__ +typedef interface IOPCShutdown IOPCShutdown; +#endif /* __IOPCShutdown_FWD_DEFINED__ */ + + +#ifndef __IOPCServerList_FWD_DEFINED__ +#define __IOPCServerList_FWD_DEFINED__ +typedef interface IOPCServerList IOPCServerList; +#endif /* __IOPCServerList_FWD_DEFINED__ */ + + +#ifndef __IOPCServerList2_FWD_DEFINED__ +#define __IOPCServerList2_FWD_DEFINED__ +typedef interface IOPCServerList2 IOPCServerList2; +#endif /* __IOPCServerList2_FWD_DEFINED__ */ + + +#ifndef __IOPCEnumGUID_FWD_DEFINED__ +#define __IOPCEnumGUID_FWD_DEFINED__ +typedef interface IOPCEnumGUID IOPCEnumGUID; +#endif /* __IOPCEnumGUID_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "comcat.h" +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +#ifndef __IOPCShutdown_INTERFACE_DEFINED__ +#define __IOPCShutdown_INTERFACE_DEFINED__ + +/* interface IOPCShutdown */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCShutdown; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F31DFDE1-07B6-11d2-B2D8-0060083BA1FB") + IOPCShutdown : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE ShutdownRequest( + /* [string][in] */ LPCWSTR szReason) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCShutdownVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCShutdown * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCShutdown * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCShutdown * This); + + HRESULT ( STDMETHODCALLTYPE *ShutdownRequest )( + IOPCShutdown * This, + /* [string][in] */ LPCWSTR szReason); + + END_INTERFACE + } IOPCShutdownVtbl; + + interface IOPCShutdown + { + CONST_VTBL struct IOPCShutdownVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCShutdown_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCShutdown_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCShutdown_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCShutdown_ShutdownRequest(This,szReason) \ + (This)->lpVtbl -> ShutdownRequest(This,szReason) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCShutdown_ShutdownRequest_Proxy( + IOPCShutdown * This, + /* [string][in] */ LPCWSTR szReason); + + +void __RPC_STUB IOPCShutdown_ShutdownRequest_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCShutdown_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCCommon_INTERFACE_DEFINED__ +#define __IOPCCommon_INTERFACE_DEFINED__ + +/* interface IOPCCommon */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCCommon; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F31DFDE2-07B6-11d2-B2D8-0060083BA1FB") + IOPCCommon : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetLocaleID( + /* [in] */ LCID dwLcid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetLocaleID( + /* [out] */ LCID *pdwLcid) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryAvailableLocaleIDs( + /* [out] */ DWORD *pdwCount, + /* [size_is][size_is][out] */ LCID **pdwLcid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetErrorString( + /* [in] */ HRESULT dwError, + /* [string][out] */ LPWSTR *ppString) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetClientName( + /* [string][in] */ LPCWSTR szName) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCCommonVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCCommon * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCCommon * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCCommon * This); + + HRESULT ( STDMETHODCALLTYPE *SetLocaleID )( + IOPCCommon * This, + /* [in] */ LCID dwLcid); + + HRESULT ( STDMETHODCALLTYPE *GetLocaleID )( + IOPCCommon * This, + /* [out] */ LCID *pdwLcid); + + HRESULT ( STDMETHODCALLTYPE *QueryAvailableLocaleIDs )( + IOPCCommon * This, + /* [out] */ DWORD *pdwCount, + /* [size_is][size_is][out] */ LCID **pdwLcid); + + HRESULT ( STDMETHODCALLTYPE *GetErrorString )( + IOPCCommon * This, + /* [in] */ HRESULT dwError, + /* [string][out] */ LPWSTR *ppString); + + HRESULT ( STDMETHODCALLTYPE *SetClientName )( + IOPCCommon * This, + /* [string][in] */ LPCWSTR szName); + + END_INTERFACE + } IOPCCommonVtbl; + + interface IOPCCommon + { + CONST_VTBL struct IOPCCommonVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCCommon_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCCommon_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCCommon_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCCommon_SetLocaleID(This,dwLcid) \ + (This)->lpVtbl -> SetLocaleID(This,dwLcid) + +#define IOPCCommon_GetLocaleID(This,pdwLcid) \ + (This)->lpVtbl -> GetLocaleID(This,pdwLcid) + +#define IOPCCommon_QueryAvailableLocaleIDs(This,pdwCount,pdwLcid) \ + (This)->lpVtbl -> QueryAvailableLocaleIDs(This,pdwCount,pdwLcid) + +#define IOPCCommon_GetErrorString(This,dwError,ppString) \ + (This)->lpVtbl -> GetErrorString(This,dwError,ppString) + +#define IOPCCommon_SetClientName(This,szName) \ + (This)->lpVtbl -> SetClientName(This,szName) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCCommon_SetLocaleID_Proxy( + IOPCCommon * This, + /* [in] */ LCID dwLcid); + + +void __RPC_STUB IOPCCommon_SetLocaleID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCCommon_GetLocaleID_Proxy( + IOPCCommon * This, + /* [out] */ LCID *pdwLcid); + + +void __RPC_STUB IOPCCommon_GetLocaleID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCCommon_QueryAvailableLocaleIDs_Proxy( + IOPCCommon * This, + /* [out] */ DWORD *pdwCount, + /* [size_is][size_is][out] */ LCID **pdwLcid); + + +void __RPC_STUB IOPCCommon_QueryAvailableLocaleIDs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCCommon_GetErrorString_Proxy( + IOPCCommon * This, + /* [in] */ HRESULT dwError, + /* [string][out] */ LPWSTR *ppString); + + +void __RPC_STUB IOPCCommon_GetErrorString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCCommon_SetClientName_Proxy( + IOPCCommon * This, + /* [string][in] */ LPCWSTR szName); + + +void __RPC_STUB IOPCCommon_SetClientName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCCommon_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCServerList_INTERFACE_DEFINED__ +#define __IOPCServerList_INTERFACE_DEFINED__ + +/* interface IOPCServerList */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCServerList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("13486D50-4821-11D2-A494-3CB306C10000") + IOPCServerList : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumClassesOfCategories( + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IEnumGUID **ppenumClsid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClassDetails( + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType) = 0; + + virtual HRESULT STDMETHODCALLTYPE CLSIDFromProgID( + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCServerListVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCServerList * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCServerList * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCServerList * This); + + HRESULT ( STDMETHODCALLTYPE *EnumClassesOfCategories )( + IOPCServerList * This, + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IEnumGUID **ppenumClsid); + + HRESULT ( STDMETHODCALLTYPE *GetClassDetails )( + IOPCServerList * This, + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType); + + HRESULT ( STDMETHODCALLTYPE *CLSIDFromProgID )( + IOPCServerList * This, + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid); + + END_INTERFACE + } IOPCServerListVtbl; + + interface IOPCServerList + { + CONST_VTBL struct IOPCServerListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCServerList_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCServerList_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCServerList_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCServerList_EnumClassesOfCategories(This,cImplemented,rgcatidImpl,cRequired,rgcatidReq,ppenumClsid) \ + (This)->lpVtbl -> EnumClassesOfCategories(This,cImplemented,rgcatidImpl,cRequired,rgcatidReq,ppenumClsid) + +#define IOPCServerList_GetClassDetails(This,clsid,ppszProgID,ppszUserType) \ + (This)->lpVtbl -> GetClassDetails(This,clsid,ppszProgID,ppszUserType) + +#define IOPCServerList_CLSIDFromProgID(This,szProgId,clsid) \ + (This)->lpVtbl -> CLSIDFromProgID(This,szProgId,clsid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCServerList_EnumClassesOfCategories_Proxy( + IOPCServerList * This, + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IEnumGUID **ppenumClsid); + + +void __RPC_STUB IOPCServerList_EnumClassesOfCategories_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServerList_GetClassDetails_Proxy( + IOPCServerList * This, + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType); + + +void __RPC_STUB IOPCServerList_GetClassDetails_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServerList_CLSIDFromProgID_Proxy( + IOPCServerList * This, + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid); + + +void __RPC_STUB IOPCServerList_CLSIDFromProgID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCServerList_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCEnumGUID_INTERFACE_DEFINED__ +#define __IOPCEnumGUID_INTERFACE_DEFINED__ + +/* interface IOPCEnumGUID */ +/* [unique][uuid][object] */ + +typedef /* [unique] */ IOPCEnumGUID *LPOPCENUMGUID; + + +EXTERN_C const IID IID_IOPCEnumGUID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("55C382C8-21C7-4e88-96C1-BECFB1E3F483") + IOPCEnumGUID : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ GUID *rgelt, + /* [out] */ ULONG *pceltFetched) = 0; + + virtual HRESULT STDMETHODCALLTYPE Skip( + /* [in] */ ULONG celt) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Clone( + /* [out] */ IOPCEnumGUID **ppenum) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCEnumGUIDVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCEnumGUID * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCEnumGUID * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCEnumGUID * This); + + HRESULT ( STDMETHODCALLTYPE *Next )( + IOPCEnumGUID * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ GUID *rgelt, + /* [out] */ ULONG *pceltFetched); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + IOPCEnumGUID * This, + /* [in] */ ULONG celt); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + IOPCEnumGUID * This); + + HRESULT ( STDMETHODCALLTYPE *Clone )( + IOPCEnumGUID * This, + /* [out] */ IOPCEnumGUID **ppenum); + + END_INTERFACE + } IOPCEnumGUIDVtbl; + + interface IOPCEnumGUID + { + CONST_VTBL struct IOPCEnumGUIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCEnumGUID_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCEnumGUID_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCEnumGUID_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCEnumGUID_Next(This,celt,rgelt,pceltFetched) \ + (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) + +#define IOPCEnumGUID_Skip(This,celt) \ + (This)->lpVtbl -> Skip(This,celt) + +#define IOPCEnumGUID_Reset(This) \ + (This)->lpVtbl -> Reset(This) + +#define IOPCEnumGUID_Clone(This,ppenum) \ + (This)->lpVtbl -> Clone(This,ppenum) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCEnumGUID_Next_Proxy( + IOPCEnumGUID * This, + /* [in] */ ULONG celt, + /* [length_is][size_is][out] */ GUID *rgelt, + /* [out] */ ULONG *pceltFetched); + + +void __RPC_STUB IOPCEnumGUID_Next_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCEnumGUID_Skip_Proxy( + IOPCEnumGUID * This, + /* [in] */ ULONG celt); + + +void __RPC_STUB IOPCEnumGUID_Skip_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCEnumGUID_Reset_Proxy( + IOPCEnumGUID * This); + + +void __RPC_STUB IOPCEnumGUID_Reset_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCEnumGUID_Clone_Proxy( + IOPCEnumGUID * This, + /* [out] */ IOPCEnumGUID **ppenum); + + +void __RPC_STUB IOPCEnumGUID_Clone_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCEnumGUID_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCServerList2_INTERFACE_DEFINED__ +#define __IOPCServerList2_INTERFACE_DEFINED__ + +/* interface IOPCServerList2 */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCServerList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9DD0B56C-AD9E-43ee-8305-487F3188BF7A") + IOPCServerList2 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumClassesOfCategories( + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IOPCEnumGUID **ppenumClsid) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClassDetails( + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType, + /* [out] */ LPOLESTR *ppszVerIndProgID) = 0; + + virtual HRESULT STDMETHODCALLTYPE CLSIDFromProgID( + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCServerList2Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCServerList2 * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCServerList2 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCServerList2 * This); + + HRESULT ( STDMETHODCALLTYPE *EnumClassesOfCategories )( + IOPCServerList2 * This, + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IOPCEnumGUID **ppenumClsid); + + HRESULT ( STDMETHODCALLTYPE *GetClassDetails )( + IOPCServerList2 * This, + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType, + /* [out] */ LPOLESTR *ppszVerIndProgID); + + HRESULT ( STDMETHODCALLTYPE *CLSIDFromProgID )( + IOPCServerList2 * This, + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid); + + END_INTERFACE + } IOPCServerList2Vtbl; + + interface IOPCServerList2 + { + CONST_VTBL struct IOPCServerList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCServerList2_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCServerList2_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCServerList2_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCServerList2_EnumClassesOfCategories(This,cImplemented,rgcatidImpl,cRequired,rgcatidReq,ppenumClsid) \ + (This)->lpVtbl -> EnumClassesOfCategories(This,cImplemented,rgcatidImpl,cRequired,rgcatidReq,ppenumClsid) + +#define IOPCServerList2_GetClassDetails(This,clsid,ppszProgID,ppszUserType,ppszVerIndProgID) \ + (This)->lpVtbl -> GetClassDetails(This,clsid,ppszProgID,ppszUserType,ppszVerIndProgID) + +#define IOPCServerList2_CLSIDFromProgID(This,szProgId,clsid) \ + (This)->lpVtbl -> CLSIDFromProgID(This,szProgId,clsid) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCServerList2_EnumClassesOfCategories_Proxy( + IOPCServerList2 * This, + /* [in] */ ULONG cImplemented, + /* [size_is][in] */ CATID rgcatidImpl[ ], + /* [in] */ ULONG cRequired, + /* [size_is][in] */ CATID rgcatidReq[ ], + /* [out] */ IOPCEnumGUID **ppenumClsid); + + +void __RPC_STUB IOPCServerList2_EnumClassesOfCategories_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServerList2_GetClassDetails_Proxy( + IOPCServerList2 * This, + /* [in] */ REFCLSID clsid, + /* [out] */ LPOLESTR *ppszProgID, + /* [out] */ LPOLESTR *ppszUserType, + /* [out] */ LPOLESTR *ppszVerIndProgID); + + +void __RPC_STUB IOPCServerList2_GetClassDetails_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCServerList2_CLSIDFromProgID_Proxy( + IOPCServerList2 * This, + /* [in] */ LPCOLESTR szProgId, + /* [out] */ LPCLSID clsid); + + +void __RPC_STUB IOPCServerList2_CLSIDFromProgID_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCServerList2_INTERFACE_DEFINED__ */ + + + +#ifndef __OPCCOMN_LIBRARY_DEFINED__ +#define __OPCCOMN_LIBRARY_DEFINED__ + +/* library OPCCOMN */ +/* [helpstring][version][uuid] */ + + + + + + + + + + + + +EXTERN_C const IID LIBID_OPCCOMN; +#endif /* __OPCCOMN_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/opc/opccomn.idl b/opc/opccomn.idl new file mode 100644 index 0000000..db83f68 --- /dev/null +++ b/opc/opccomn.idl @@ -0,0 +1,241 @@ +//============================================================================== +// TITLE: OpcComn.idl +// +// CONTENTS: +// +// Interface declarations for the OPC Common specification. +// +// (c) Copyright 1998-2002 The OPC Foundation +// ALL RIGHTS RESERVED. +// +// DISCLAIMER: +// This code is provided by the OPC Foundation solely to assist in +// understanding and use of the appropriate OPC Specification(s) and may be +// used as set forth in the License Grant section of the OPC Specification. +// This code is provided as-is and without warranty or support of any sort +// and is subject to the Warranty and Liability Disclaimers which appear +// in the printed OPC Specification. +// +// MODIFICATION LOG: +// +// Date By Notes +// ---------- --- ----- +// 1998/04/09 acc import unknwn.idl rather than oaidl.idl +// 1998/06/15 acc add 'library' object at end to allow typelib generation +// 1998/06/19 acc change V2 uuids prior to final release +// to avoid conflict with 'old' OPCDA Automation uuids +// 1998/09/18 acc add OPCServerList IDL (with help from Gary Klassen) +// 2002/08/21 rsa Added asynchrounous UUIDs. Fixed formatting. +// + +import "comcat.idl"; +import "oaidl.idl"; +import "ocidl.idl"; +import "objidl.idl"; + +//============================================================================== +// IOPCShutdown + +[ + object, + uuid(F31DFDE1-07B6-11d2-B2D8-0060083BA1FB), + // async_uuid(32E8D701-A335-4fc1-8F4B-663F505C7D62), + pointer_default(unique) +] +interface IOPCShutdown : IUnknown +{ + HRESULT ShutdownRequest( + [in, string] LPCWSTR szReason + ); +} + +//============================================================================= +// IOPCCommon + +[ + object, + uuid(F31DFDE2-07B6-11d2-B2D8-0060083BA1FB), + // async_uuid(32E8D702-A335-4fc1-8F4B-663F505C7D62), + pointer_default(unique) +] +interface IOPCCommon : IUnknown +{ + + HRESULT SetLocaleID( + [in] LCID dwLcid + ); + + HRESULT GetLocaleID( + [out] LCID *pdwLcid + ); + + HRESULT QueryAvailableLocaleIDs( + [out] DWORD * pdwCount, + [out, size_is(,*pdwCount)] LCID ** pdwLcid + ); + + HRESULT GetErrorString( + [in] HRESULT dwError, + [out, string] LPWSTR * ppString + ); + + HRESULT SetClientName( + [in, string] LPCWSTR szName + ); +} + +//============================================================================== +// IOPCServerList +// +// The OPCEnum.EXE object provided by the OPC Foundation supports the +// IOPCServerList interface via DCOM to allow clients to determine available +// OPC servers on remote machines + +[ + object, + uuid(13486D50-4821-11D2-A494-3CB306C10000), + // async_uuid(32E8D703-A335-4fc1-8F4B-663F505C7D62), + pointer_default(unique) +] +interface IOPCServerList : IUnknown +{ + HRESULT EnumClassesOfCategories( + [in] ULONG cImplemented, + [in,size_is(cImplemented)] CATID rgcatidImpl[], + [in] ULONG cRequired, + [in,size_is(cRequired)] CATID rgcatidReq[], + [out] IEnumGUID ** ppenumClsid + ); + + HRESULT GetClassDetails( + [in] REFCLSID clsid, + [out] LPOLESTR* ppszProgID, + [out] LPOLESTR* ppszUserType + ); + + HRESULT CLSIDFromProgID( + [in] LPCOLESTR szProgId, + [out] LPCLSID clsid + ); +}; + +//============================================================================== +// IOPCEnumGUID +// +// The OPCEnum.EXE object now has an interface +// IOPCServerList2 which uses IOPCEnumGUID rather than +// the standard MS IEnumGUID. This was done to work +// around problems with the MS version on certain +// system configurations. IOPCEnumGUID is impelmented +// in OPCEnum.EXE. + +[ + object, + uuid(55C382C8-21C7-4e88-96C1-BECFB1E3F483), + // async_uuid(32E8D704-A335-4fc1-8F4B-663F505C7D62), + pointer_default(unique) +] +interface IOPCEnumGUID : IUnknown +{ + typedef [unique] IOPCEnumGUID * LPOPCENUMGUID; + + HRESULT Next( + [in] ULONG celt, + [out, size_is(celt), length_is(*pceltFetched)] GUID * rgelt, + [out] ULONG * pceltFetched + ); + + HRESULT Skip( + [in] ULONG celt + ); + + HRESULT Reset(); + + HRESULT Clone( + [out] IOPCEnumGUID **ppenum + ); +} + +//============================================================================== +// IOPCServerList2 + +[ + object, + uuid(9DD0B56C-AD9E-43ee-8305-487F3188BF7A), + // async_uuid(32E8D705-A335-4fc1-8F4B-663F505C7D62), + pointer_default(unique) +] +interface IOPCServerList2 : IUnknown +{ + HRESULT EnumClassesOfCategories( + [in] ULONG cImplemented, + [in,size_is(cImplemented)] CATID rgcatidImpl[], + [in] ULONG cRequired, + [in,size_is(cRequired)] CATID rgcatidReq[], + [out] IOPCEnumGUID ** ppenumClsid + ); + + HRESULT GetClassDetails( + [in] REFCLSID clsid, + [out] LPOLESTR* ppszProgID, + [out] LPOLESTR* ppszUserType, + [out] LPOLESTR* ppszVerIndProgID + ); + + HRESULT CLSIDFromProgID( + [in] LPCOLESTR szProgId, + [out] LPCLSID clsid + ); +}; + +//============================================================================== +// Type Library + +[ + uuid(B28EEDB1-AC6F-11d1-84D5-00608CB8A7E9), + version(1.10), + helpstring("OPC Common 1.10 Type Library") +] +library OPCCOMN +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + //========================================================================== + // Standard Interfaces + + interface IEnumString; + interface IEnumUnknown; + interface IEnumGUID; + interface IConnectionPointContainer; + interface IConnectionPoint; + + //========================================================================== + // OPC Synchronous Interfaces + + interface IOPCCommon; + interface IOPCShutdown; + interface IOpcServerList; + interface IOPCServerList2; + interface IOPCEnumGUID; + + //========================================================================== + // Standard Asynchronous Interfaces + + // interface ICallFactory; + // interface ICancelMethodCalls; + // interface IAsyncManager; + // interface ISynchronize; + // interface IWaitMultiple; + + //========================================================================== + // OPC Asynchronous Interfaces + + // interface AsyncIOPCCommon; + // interface AsyncIOPCShutdown; + // interface AsyncIOpcServerList; + // interface AsyncIOPCServerList2; + // interface AsyncIOPCEnumGUID; +}; + + diff --git a/opc/opccomn_i.c b/opc/opccomn_i.c new file mode 100644 index 0000000..4b4e99a --- /dev/null +++ b/opc/opccomn_i.c @@ -0,0 +1,99 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 6.00.0361 */ +/* at Fri Nov 25 09:10:36 2005 + */ +/* Compiler settings for .\opccomn.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#if !defined(_M_IA64) && !defined(_M_AMD64) + + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_IOPCShutdown,0xF31DFDE1,0x07B6,0x11d2,0xB2,0xD8,0x00,0x60,0x08,0x3B,0xA1,0xFB); + + +MIDL_DEFINE_GUID(IID, IID_IOPCCommon,0xF31DFDE2,0x07B6,0x11d2,0xB2,0xD8,0x00,0x60,0x08,0x3B,0xA1,0xFB); + + +MIDL_DEFINE_GUID(IID, IID_IOPCServerList,0x13486D50,0x4821,0x11D2,0xA4,0x94,0x3C,0xB3,0x06,0xC1,0x00,0x00); + + +MIDL_DEFINE_GUID(IID, IID_IOPCEnumGUID,0x55C382C8,0x21C7,0x4e88,0x96,0xC1,0xBE,0xCF,0xB1,0xE3,0xF4,0x83); + + +MIDL_DEFINE_GUID(IID, IID_IOPCServerList2,0x9DD0B56C,0xAD9E,0x43ee,0x83,0x05,0x48,0x7F,0x31,0x88,0xBF,0x7A); + + +MIDL_DEFINE_GUID(IID, LIBID_OPCCOMN,0xB28EEDB1,0xAC6F,0x11d1,0x84,0xD5,0x00,0x60,0x8C,0xB8,0xA7,0xE9); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + +#endif /* !defined(_M_IA64) && !defined(_M_AMD64)*/ + diff --git a/opc/opcsec.h b/opc/opcsec.h new file mode 100644 index 0000000..ffaf972 --- /dev/null +++ b/opc/opcsec.h @@ -0,0 +1,370 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* at Fri Mar 23 11:47:51 2012 + */ +/* Compiler settings for opcsec.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, app_config, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __opcsec_h__ +#define __opcsec_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __IOPCSecurityNT_FWD_DEFINED__ +#define __IOPCSecurityNT_FWD_DEFINED__ +typedef interface IOPCSecurityNT IOPCSecurityNT; +#endif /* __IOPCSecurityNT_FWD_DEFINED__ */ + + +#ifndef __IOPCSecurityPrivate_FWD_DEFINED__ +#define __IOPCSecurityPrivate_FWD_DEFINED__ +typedef interface IOPCSecurityPrivate IOPCSecurityPrivate; +#endif /* __IOPCSecurityPrivate_FWD_DEFINED__ */ + + +#ifndef __IOPCSecurityNT_FWD_DEFINED__ +#define __IOPCSecurityNT_FWD_DEFINED__ +typedef interface IOPCSecurityNT IOPCSecurityNT; +#endif /* __IOPCSecurityNT_FWD_DEFINED__ */ + + +#ifndef __IOPCSecurityPrivate_FWD_DEFINED__ +#define __IOPCSecurityPrivate_FWD_DEFINED__ +typedef interface IOPCSecurityPrivate IOPCSecurityPrivate; +#endif /* __IOPCSecurityPrivate_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +#ifndef __IOPCSecurityNT_INTERFACE_DEFINED__ +#define __IOPCSecurityNT_INTERFACE_DEFINED__ + +/* interface IOPCSecurityNT */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCSecurityNT; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7AA83A01-6C77-11d3-84F9-00008630A38B") + IOPCSecurityNT : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IsAvailableNT( + /* [out] */ BOOL *pbAvailable) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryMinImpersonationLevel( + /* [out] */ DWORD *pdwMinImpLevel) = 0; + + virtual HRESULT STDMETHODCALLTYPE ChangeUser( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCSecurityNTVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCSecurityNT * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCSecurityNT * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCSecurityNT * This); + + HRESULT ( STDMETHODCALLTYPE *IsAvailableNT )( + IOPCSecurityNT * This, + /* [out] */ BOOL *pbAvailable); + + HRESULT ( STDMETHODCALLTYPE *QueryMinImpersonationLevel )( + IOPCSecurityNT * This, + /* [out] */ DWORD *pdwMinImpLevel); + + HRESULT ( STDMETHODCALLTYPE *ChangeUser )( + IOPCSecurityNT * This); + + END_INTERFACE + } IOPCSecurityNTVtbl; + + interface IOPCSecurityNT + { + CONST_VTBL struct IOPCSecurityNTVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCSecurityNT_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCSecurityNT_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCSecurityNT_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCSecurityNT_IsAvailableNT(This,pbAvailable) \ + (This)->lpVtbl -> IsAvailableNT(This,pbAvailable) + +#define IOPCSecurityNT_QueryMinImpersonationLevel(This,pdwMinImpLevel) \ + (This)->lpVtbl -> QueryMinImpersonationLevel(This,pdwMinImpLevel) + +#define IOPCSecurityNT_ChangeUser(This) \ + (This)->lpVtbl -> ChangeUser(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCSecurityNT_IsAvailableNT_Proxy( + IOPCSecurityNT * This, + /* [out] */ BOOL *pbAvailable); + + +void __RPC_STUB IOPCSecurityNT_IsAvailableNT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCSecurityNT_QueryMinImpersonationLevel_Proxy( + IOPCSecurityNT * This, + /* [out] */ DWORD *pdwMinImpLevel); + + +void __RPC_STUB IOPCSecurityNT_QueryMinImpersonationLevel_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCSecurityNT_ChangeUser_Proxy( + IOPCSecurityNT * This); + + +void __RPC_STUB IOPCSecurityNT_ChangeUser_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCSecurityNT_INTERFACE_DEFINED__ */ + + +#ifndef __IOPCSecurityPrivate_INTERFACE_DEFINED__ +#define __IOPCSecurityPrivate_INTERFACE_DEFINED__ + +/* interface IOPCSecurityPrivate */ +/* [unique][uuid][object] */ + + +EXTERN_C const IID IID_IOPCSecurityPrivate; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7AA83A02-6C77-11d3-84F9-00008630A38B") + IOPCSecurityPrivate : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IsAvailablePriv( + /* [out] */ BOOL *pbAvailable) = 0; + + virtual HRESULT STDMETHODCALLTYPE Logon( + /* [string][in] */ LPCWSTR szUserID, + /* [string][in] */ LPCWSTR szPassword) = 0; + + virtual HRESULT STDMETHODCALLTYPE Logoff( void) = 0; + + }; + +#else /* C style interface */ + + typedef struct IOPCSecurityPrivateVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + IOPCSecurityPrivate * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + IOPCSecurityPrivate * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + IOPCSecurityPrivate * This); + + HRESULT ( STDMETHODCALLTYPE *IsAvailablePriv )( + IOPCSecurityPrivate * This, + /* [out] */ BOOL *pbAvailable); + + HRESULT ( STDMETHODCALLTYPE *Logon )( + IOPCSecurityPrivate * This, + /* [string][in] */ LPCWSTR szUserID, + /* [string][in] */ LPCWSTR szPassword); + + HRESULT ( STDMETHODCALLTYPE *Logoff )( + IOPCSecurityPrivate * This); + + END_INTERFACE + } IOPCSecurityPrivateVtbl; + + interface IOPCSecurityPrivate + { + CONST_VTBL struct IOPCSecurityPrivateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IOPCSecurityPrivate_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IOPCSecurityPrivate_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IOPCSecurityPrivate_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IOPCSecurityPrivate_IsAvailablePriv(This,pbAvailable) \ + (This)->lpVtbl -> IsAvailablePriv(This,pbAvailable) + +#define IOPCSecurityPrivate_Logon(This,szUserID,szPassword) \ + (This)->lpVtbl -> Logon(This,szUserID,szPassword) + +#define IOPCSecurityPrivate_Logoff(This) \ + (This)->lpVtbl -> Logoff(This) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +HRESULT STDMETHODCALLTYPE IOPCSecurityPrivate_IsAvailablePriv_Proxy( + IOPCSecurityPrivate * This, + /* [out] */ BOOL *pbAvailable); + + +void __RPC_STUB IOPCSecurityPrivate_IsAvailablePriv_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCSecurityPrivate_Logon_Proxy( + IOPCSecurityPrivate * This, + /* [string][in] */ LPCWSTR szUserID, + /* [string][in] */ LPCWSTR szPassword); + + +void __RPC_STUB IOPCSecurityPrivate_Logon_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +HRESULT STDMETHODCALLTYPE IOPCSecurityPrivate_Logoff_Proxy( + IOPCSecurityPrivate * This); + + +void __RPC_STUB IOPCSecurityPrivate_Logoff_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __IOPCSecurityPrivate_INTERFACE_DEFINED__ */ + + + +#ifndef __OPCSEC_LIBRARY_DEFINED__ +#define __OPCSEC_LIBRARY_DEFINED__ + +/* library OPCSEC */ +/* [helpstring][version][uuid] */ + + + + +EXTERN_C const IID LIBID_OPCSEC; +#endif /* __OPCSEC_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/opc/opcsec.idl b/opc/opcsec.idl new file mode 100644 index 0000000..eaf2e23 --- /dev/null +++ b/opc/opcsec.idl @@ -0,0 +1,91 @@ +//============================================================================== +// TITLE: OpcSec.idl +// +// CONTENTS: +// +// Interface declarations for the OPC Security specifications. +// +// (c) Copyright 1999-2003 The OPC Foundation +// ALL RIGHTS RESERVED. +// +// DISCLAIMER: +// This code is provided by the OPC Foundation solely to assist in +// understanding and use of the appropriate OPC Specification(s) and may be +// used as set forth in the License Grant section of the OPC Specification. +// This code is provided as-is and without warranty or support of any sort +// and is subject to the Warranty and Liability Disclaimers which appear +// in the printed OPC Specification. +// +// MODIFICATION LOG: +// +// Date By Notes +// ---------- --- ----- +// 2000/08/03 DJ Finalized for spec release 1.00 +// 2003/01/06 RSA Fixed formatting to comply with coding guidelines. +// + +import "oaidl.idl"; + +//============================================================================== +// IOPCSecurityNT + +[ + object, + uuid(7AA83A01-6C77-11d3-84F9-00008630A38B), + pointer_default(unique) +] +interface IOPCSecurityNT : IUnknown +{ + HRESULT IsAvailableNT( + [out] BOOL* pbAvailable + ); + + HRESULT QueryMinImpersonationLevel( + [out] DWORD* pdwMinImpLevel + ); + + HRESULT ChangeUser( + void + ); +}; + +//============================================================================== +// IOPCSecurityPrivate + +[ + object, + uuid(7AA83A02-6C77-11d3-84F9-00008630A38B), + pointer_default(unique) +] +interface IOPCSecurityPrivate : IUnknown +{ + HRESULT IsAvailablePriv( + [out] BOOL* pbAvailable + ); + + HRESULT Logon( + [in, string] LPCWSTR szUserID, + [in, string] LPCWSTR szPassword + ); + + HRESULT Logoff( + void + ); +}; + +//============================================================================== +// Type Library + +[ + uuid(7AA83AFF-6C77-11d3-84F9-00008630A38B), + version(1.00), + helpstring("OPC Security 1.00 Type Library") +] +library OPCSEC +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + interface IOPCSecurityNT; + interface IOPCSecurityPrivate; +}; diff --git a/opc/opcsec_i.c b/opc/opcsec_i.c new file mode 100644 index 0000000..503aa15 --- /dev/null +++ b/opc/opcsec_i.c @@ -0,0 +1,85 @@ + + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* at Fri Mar 23 11:47:51 2012 + */ +/* Compiler settings for opcsec.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, app_config, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif !_MIDL_USE_GUIDDEF_ + +MIDL_DEFINE_GUID(IID, IID_IOPCSecurityNT,0x7AA83A01,0x6C77,0x11d3,0x84,0xF9,0x00,0x00,0x86,0x30,0xA3,0x8B); + + +MIDL_DEFINE_GUID(IID, IID_IOPCSecurityPrivate,0x7AA83A02,0x6C77,0x11d3,0x84,0xF9,0x00,0x00,0x86,0x30,0xA3,0x8B); + + +MIDL_DEFINE_GUID(IID, LIBID_OPCSEC,0x7AA83AFF,0x6C77,0x11d3,0x84,0xF9,0x00,0x00,0x86,0x30,0xA3,0x8B); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + + + diff --git a/test_opc.lua b/test_opc.lua index 5127716..773e9f0 100644 --- a/test_opc.lua +++ b/test_opc.lua @@ -3,6 +3,7 @@ require "comgen" require "opclib" require "connpoint" require "opcae" +require "opcsec" local srv = comgen.CreateInstance("Matrikon.OPC.Simulation.1", opclib.IOPCServer) local hgrp, rate, mgt = srv:AddGroup("Group1", true, 0, 0, 0, opclib.IOPCItemMgt) @@ -116,6 +117,10 @@ end local wrap2 = opcae.EventSink(es) local cookie = cp:Advise(wrap2.__interfaces.IOPCEventSink) -while comgen.MessageStep() do - print("step") -end +--while comgen.MessageStep() do +-- print("step") +--end + +local sec = srv:QueryInterface(opcsec.IOPCSecurityPrivate) +print(sec:IsAvailablePriv()) +print(sec:Logon("foo", "bar"))