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

📄 opc_ae_ps.cpp

📁 VXWORKS源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
HRESULT STDMETHODCALLTYPE IOPCEventServer_TranslateToItemIDs_vxproxy (IOPCEventServer* pThis, LPWSTR szSource, DWORD dwEventCategory, LPWSTR szConditionName, LPWSTR szSubconditionName, DWORD dwCount, DWORD* pdwAssocAttrIDs, LPWSTR** ppszAttrItemIDs, LPWSTR** ppszNodeNames, CLSID** ppCLSIDs)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 11, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&szSource, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&dwEventCategory, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&szConditionName, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&szSubconditionName, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&dwCount, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pdwAssocAttrIDs, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD), dwCount))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&ppszAttrItemIDs, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR))))); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszNodeNames, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR))))); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppCLSIDs, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(StructDesc__GUID (ndrtypes), NDR_SIZEOF(CLSID))))); if (FAILED(hr)) return hr;    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_TranslateToItemIDs_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    LPWSTR szSource;    hr=widlUnmarshal (&szSource, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    DWORD dwEventCategory;    hr=widlUnmarshal (&dwEventCategory, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    LPWSTR szConditionName;    hr=widlUnmarshal (&szConditionName, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    LPWSTR szSubconditionName;    hr=widlUnmarshal (&szSubconditionName, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    DWORD dwCount;    hr=widlUnmarshal (&dwCount, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    DWORD* pdwAssocAttrIDs;    hr=widlUnmarshal (&pdwAssocAttrIDs, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD)))); if (FAILED(hr)) return hr;    LPWSTR* ppszAttrItemIDs_tmp;    LPWSTR** ppszAttrItemIDs = &ppszAttrItemIDs_tmp;    LPWSTR* ppszNodeNames_tmp;    LPWSTR** ppszNodeNames = &ppszNodeNames_tmp;    CLSID* ppCLSIDs_tmp;    CLSID** ppCLSIDs = &ppCLSIDs_tmp;    hrMethod = pitf->TranslateToItemIDs (szSource, dwEventCategory, szConditionName, szSubconditionName, dwCount, pdwAssocAttrIDs, ppszAttrItemIDs, ppszNodeNames, ppCLSIDs);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&ppszAttrItemIDs, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwCount)))); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszNodeNames, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwCount)))); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppCLSIDs, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(StructDesc__GUID (ndrtypes), NDR_SIZEOF(CLSID), dwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppszAttrItemIDs)) {{for (DWORD __ix=0; __ix < dwCount; ++__ix) {if (((*ppszAttrItemIDs)[__ix])) {CoTaskMemFree (((*ppszAttrItemIDs)[__ix]));}}}CoTaskMemFree ((*ppszAttrItemIDs));}if ((*ppszNodeNames)) {{for (DWORD __ix=0; __ix < dwCount; ++__ix) {if (((*ppszNodeNames)[__ix])) {CoTaskMemFree (((*ppszNodeNames)[__ix]));}}}CoTaskMemFree ((*ppszNodeNames));}if ((*ppCLSIDs)) {CoTaskMemFree ((*ppCLSIDs));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_GetConditionState_vxproxy (IOPCEventServer* pThis, LPWSTR szSource, LPWSTR szConditionName, DWORD dwNumEventAttrs, DWORD* pdwAttributeIDs, OPCCONDITIONSTATE** ppConditionState)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 12, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&szSource, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&szConditionName, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&dwNumEventAttrs, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pdwAttributeIDs, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD), dwNumEventAttrs))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&ppConditionState, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(StructDesc_tagOPCCONDITIONSTATE (ndrtypes)))); if (FAILED(hr)) return hr;    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_GetConditionState_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    LPWSTR szSource;    hr=widlUnmarshal (&szSource, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    LPWSTR szConditionName;    hr=widlUnmarshal (&szConditionName, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    DWORD dwNumEventAttrs;    hr=widlUnmarshal (&dwNumEventAttrs, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    DWORD* pdwAttributeIDs;    hr=widlUnmarshal (&pdwAttributeIDs, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD)))); if (FAILED(hr)) return hr;    OPCCONDITIONSTATE* ppConditionState_tmp;    OPCCONDITIONSTATE** ppConditionState = &ppConditionState_tmp;    hrMethod = pitf->GetConditionState (szSource, szConditionName, dwNumEventAttrs, pdwAttributeIDs, ppConditionState);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&ppConditionState, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(StructDesc_tagOPCCONDITIONSTATE (ndrtypes)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppConditionState)) {if ((*(*ppConditionState)).szActiveSubCondition) {CoTaskMemFree ((*(*ppConditionState)).szActiveSubCondition);}if ((*(*ppConditionState)).szASCDefinition) {CoTaskMemFree ((*(*ppConditionState)).szASCDefinition);}if ((*(*ppConditionState)).szASCDescription) {CoTaskMemFree ((*(*ppConditionState)).szASCDescription);}if ((*(*ppConditionState)).szAcknowledgerID) {CoTaskMemFree ((*(*ppConditionState)).szAcknowledgerID);}if ((*(*ppConditionState)).szComment) {CoTaskMemFree ((*(*ppConditionState)).szComment);}if ((*(*ppConditionState)).pszSCNames) {{for (DWORD __ix=0; __ix < (*(*ppConditionState)).dwNumSCs; ++__ix) {if (((*(*ppConditionState)).pszSCNames[__ix])) {CoTaskMemFree (((*(*ppConditionState)).pszSCNames[__ix]));}}}CoTaskMemFree ((*(*ppConditionState)).pszSCNames);}if ((*(*ppConditionState)).pszSCDefinitions) {{for (DWORD __ix=0; __ix < (*(*ppConditionState)).dwNumSCs; ++__ix) {if (((*(*ppConditionState)).pszSCDefinitions[__ix])) {CoTaskMemFree (((*(*ppConditionState)).pszSCDefinitions[__ix]));}}}CoTaskMemFree ((*(*ppConditionState)).pszSCDefinitions);}if ((*(*ppConditionState)).pdwSCSeverities) {CoTaskMemFree ((*(*ppConditionState)).pdwSCSeverities);}if ((*(*ppConditionState)).pszSCDescriptions) {{for (DWORD __ix=0; __ix < (*(*ppConditionState)).dwNumSCs; ++__ix) {if (((*(*ppConditionState)).pszSCDescriptions[__ix])) {CoTaskMemFree (((*(*ppConditionState)).pszSCDescriptions[__ix]));}}}CoTaskMemFree ((*(*ppConditionState)).pszSCDescriptions);}if ((*(*ppConditionState)).pEventAttributes) {{for (DWORD __ix=0; __ix < (*(*ppConditionState)).dwNumEventAttrs; ++__ix) {::VariantClear (&(((*(*ppConditionState)).pEventAttributes[__ix]))); }}CoTaskMemFree ((*(*ppConditionState)).pEventAttributes);}if ((*(*ppConditionState)).pErrors) {CoTaskMemFree ((*(*ppConditionState)).pErrors);}CoTaskMemFree ((*ppConditionState));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_EnableConditionByArea_vxproxy (IOPCEventServer* pThis, DWORD dwNumAreas, LPWSTR* pszAreas)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 13, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwNumAreas, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pszAreas, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwNumAreas))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_EnableConditionByArea_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwNumAreas;    hr=widlUnmarshal (&dwNumAreas, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    LPWSTR* pszAreas;    hr=widlUnmarshal (&pszAreas, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR)))); if (FAILED(hr)) return hr;    hrMethod = pitf->EnableConditionByArea (dwNumAreas, pszAreas);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_EnableConditionBySource_vxproxy (IOPCEventServer* pThis, DWORD dwNumSources, LPWSTR* pszSources)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 14, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwNumSources, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pszSources, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwNumSources))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_EnableConditionBySource_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwNumSources;    hr=widlUnmarshal (&dwNumSources, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    LPWSTR* pszSources;    hr=widlUnmarshal (&pszSources, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR)))); if (FAILED(hr)) return hr;    hrMethod = pitf->EnableConditionBySource (dwNumSources, pszSources);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_DisableConditionByArea_vxproxy (IOPCEventServer* pThis, DWORD dwNumAreas, LPWSTR* pszAreas)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 15, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwNumAreas, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pszAreas, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwNumAreas))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_DisableConditionByArea_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwNumAreas;    hr=widlUnmarshal (&dwNumAreas, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    LPWSTR* pszAreas;    hr=widlUnmarshal (&pszAreas, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR)))); if (FAILED(hr)) return hr;    hrMethod = pitf->DisableConditionByArea (dwNumAreas, pszAreas);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_DisableConditionBySource_vxproxy (IOPCEventServer* pThis, DWORD dwNumSources, LPWSTR* pszSources)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 16, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwNumSources, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr=widlMarshal (&pszSources, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), dwNumSources))); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;

⌨️ 快捷键说明

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