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

📄 opc_ae_ps.cpp

📁 VXWORKS源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    hrMethod = pitf->QueryAvailableFilters (pdwFilterMask);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwFilterMask, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryEventCategories_vxproxy (IOPCEventServer* pThis, DWORD dwEventType, DWORD* pdwCount, DWORD** ppdwEventCategories, LPWSTR** ppszEventCategoryDescs)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 6, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwEventType, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&pdwCount, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppdwEventCategories, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD))))); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszEventCategoryDescs, 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 (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryEventCategories_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwEventType;    hr=widlUnmarshal (&dwEventType, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    DWORD pdwCount_tmp;    DWORD* pdwCount = &pdwCount_tmp;    DWORD* ppdwEventCategories_tmp;    DWORD** ppdwEventCategories = &ppdwEventCategories_tmp;    LPWSTR* ppszEventCategoryDescs_tmp;    LPWSTR** ppszEventCategoryDescs = &ppszEventCategoryDescs_tmp;    hrMethod = pitf->QueryEventCategories (dwEventType, pdwCount, ppdwEventCategories, ppszEventCategoryDescs);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwCount, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppdwEventCategories, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD), *pdwCount)))); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszEventCategoryDescs, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), *pdwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppdwEventCategories)) {CoTaskMemFree ((*ppdwEventCategories));}if ((*ppszEventCategoryDescs)) {{for (DWORD __ix=0; __ix < *pdwCount; ++__ix) {if (((*ppszEventCategoryDescs)[__ix])) {CoTaskMemFree (((*ppszEventCategoryDescs)[__ix]));}}}CoTaskMemFree ((*ppszEventCategoryDescs));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryConditionNames_vxproxy (IOPCEventServer* pThis, DWORD dwEventCategory, DWORD* pdwCount, LPWSTR** ppszConditionNames)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 7, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwEventCategory, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&pdwCount, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszConditionNames, 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 (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryConditionNames_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwEventCategory;    hr=widlUnmarshal (&dwEventCategory, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    DWORD pdwCount_tmp;    DWORD* pdwCount = &pdwCount_tmp;    LPWSTR* ppszConditionNames_tmp;    LPWSTR** ppszConditionNames = &ppszConditionNames_tmp;    hrMethod = pitf->QueryConditionNames (dwEventCategory, pdwCount, ppszConditionNames);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwCount, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszConditionNames, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), *pdwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppszConditionNames)) {{for (DWORD __ix=0; __ix < *pdwCount; ++__ix) {if (((*ppszConditionNames)[__ix])) {CoTaskMemFree (((*ppszConditionNames)[__ix]));}}}CoTaskMemFree ((*ppszConditionNames));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QuerySubConditionNames_vxproxy (IOPCEventServer* pThis, LPWSTR szConditionName, DWORD* pdwCount, LPWSTR** ppszSubConditionNames)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 8, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&szConditionName, pms, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&pdwCount, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszSubConditionNames, 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 (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QuerySubConditionNames_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    LPWSTR szConditionName;    hr=widlUnmarshal (&szConditionName, pus, ndrtypes.refptr_t(ndrtypes.wstring_t ())); if (FAILED(hr)) return hr;    DWORD pdwCount_tmp;    DWORD* pdwCount = &pdwCount_tmp;    LPWSTR* ppszSubConditionNames_tmp;    LPWSTR** ppszSubConditionNames = &ppszSubConditionNames_tmp;    hrMethod = pitf->QuerySubConditionNames (szConditionName, pdwCount, ppszSubConditionNames);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwCount, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszSubConditionNames, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), *pdwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppszSubConditionNames)) {{for (DWORD __ix=0; __ix < *pdwCount; ++__ix) {if (((*ppszSubConditionNames)[__ix])) {CoTaskMemFree (((*ppszSubConditionNames)[__ix]));}}}CoTaskMemFree ((*ppszSubConditionNames));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QuerySourceConditions_vxproxy (IOPCEventServer* pThis, LPWSTR szSource, DWORD* pdwCount, LPWSTR** ppszConditionNames)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 9, 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 = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&pdwCount, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszConditionNames, 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 (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QuerySourceConditions_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 pdwCount_tmp;    DWORD* pdwCount = &pdwCount_tmp;    LPWSTR* ppszConditionNames_tmp;    LPWSTR** ppszConditionNames = &ppszConditionNames_tmp;    hrMethod = pitf->QuerySourceConditions (szSource, pdwCount, ppszConditionNames);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwCount, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszConditionNames, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), *pdwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppszConditionNames)) {{for (DWORD __ix=0; __ix < *pdwCount; ++__ix) {if (((*ppszConditionNames)[__ix])) {CoTaskMemFree (((*ppszConditionNames)[__ix]));}}}CoTaskMemFree ((*ppszConditionNames));};    return S_OK;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryEventAttributes_vxproxy (IOPCEventServer* pThis, DWORD dwEventCategory, DWORD* pdwCount, DWORD** ppdwAttrIDs, LPWSTR** ppszAttrDescs, VARTYPE** ppvtAttrTypes)    {    RPC_PROXY_MSG	msg (IID_IOPCEventServer, RpcMode::OBJECT, 10, pThis);    NDRTYPES		ndrtypes;    HRESULT		hrMethod;    HRESULT		hr;    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&dwEventCategory, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    hr = msg.SendReceive (); if (FAILED (hr)) return hr;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    hr=widlUnmarshal (&pdwCount, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppdwAttrIDs, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD))))); if (FAILED(hr)) return hr;    hr=widlUnmarshal (&ppszAttrDescs, 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 (&ppvtAttrTypes, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ushort_t (), NDR_SIZEOF(VARTYPE))))); if (FAILED(hr)) return hr;    hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    return hrMethod;    }HRESULT STDMETHODCALLTYPE IOPCEventServer_QueryEventAttributes_vxstub (IOPCEventServer* pitf, RPC_STUB_MSG& msg)    {    NDRTYPES	ndrtypes;    HRESULT	hr;    HRESULT	hrMethod;    NdrUnmarshalStream* pus = msg.unmarshalStreamGet ();    DWORD dwEventCategory;    hr=widlUnmarshal (&dwEventCategory, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr;    DWORD pdwCount_tmp;    DWORD* pdwCount = &pdwCount_tmp;    DWORD* ppdwAttrIDs_tmp;    DWORD** ppdwAttrIDs = &ppdwAttrIDs_tmp;    LPWSTR* ppszAttrDescs_tmp;    LPWSTR** ppszAttrDescs = &ppszAttrDescs_tmp;    VARTYPE* ppvtAttrTypes_tmp;    VARTYPE** ppvtAttrTypes = &ppvtAttrTypes_tmp;    hrMethod = pitf->QueryEventAttributes (dwEventCategory, pdwCount, ppdwAttrIDs, ppszAttrDescs, ppvtAttrTypes);    NdrMarshalStream* pms = msg.marshalStreamGet ();    hr=widlMarshal (&pdwCount, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppdwAttrIDs, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(DWORD), *pdwCount)))); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppszAttrDescs, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.pointer_t(ndrtypes.wstring_t ()), NDR_SIZEOF(LPWSTR), *pdwCount)))); if (FAILED(hr)) return hr;    hr=widlMarshal (&ppvtAttrTypes, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.ushort_t (), NDR_SIZEOF(VARTYPE), *pdwCount)))); if (FAILED(hr)) return hr;    hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t());    if (FAILED(hr))        return hr;    if ((*ppdwAttrIDs)) {CoTaskMemFree ((*ppdwAttrIDs));}if ((*ppszAttrDescs)) {{for (DWORD __ix=0; __ix < *pdwCount; ++__ix) {if (((*ppszAttrDescs)[__ix])) {CoTaskMemFree (((*ppszAttrDescs)[__ix]));}}}CoTaskMemFree ((*ppszAttrDescs));}if ((*ppvtAttrTypes)) {CoTaskMemFree ((*ppvtAttrTypes));};    return S_OK;    }

⌨️ 快捷键说明

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