?? opcda_ps.cpp
字號:
return hr; if ((*ppItemValues)) {{for (DWORD __ix=0; __ix < dwCount; ++__ix) {::VariantClear (&(((*ppItemValues)[__ix]).vDataValue)); }}CoTaskMemFree ((*ppItemValues));}if ((*ppErrors)) {CoTaskMemFree ((*ppErrors));}; return S_OK; }HRESULT STDMETHODCALLTYPE IOPCSyncIO_Write_vxproxy (IOPCSyncIO* pThis, DWORD dwCount, OPCHANDLE* phServer, VARIANT* pItemValues, HRESULT** ppErrors) { RPC_PROXY_MSG msg (IID_IOPCSyncIO, RpcMode::OBJECT, 4, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwCount, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&phServer, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE), dwCount))); if (FAILED(hr)) return hr; hr=widlMarshal (&pItemValues, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.variant_t (), NDR_SIZEOF(VARIANT), dwCount))); if (FAILED(hr)) return hr; hr = msg.SendReceive (); if (FAILED (hr)) return hr; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); hr=widlUnmarshal (&ppErrors, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT))))); if (FAILED(hr)) return hr; hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; return hrMethod; }HRESULT STDMETHODCALLTYPE IOPCSyncIO_Write_vxstub (IOPCSyncIO* pitf, RPC_STUB_MSG& msg) { NDRTYPES ndrtypes; HRESULT hr; HRESULT hrMethod; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); DWORD dwCount; hr=widlUnmarshal (&dwCount, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; OPCHANDLE* phServer; hr=widlUnmarshal (&phServer, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE)))); if (FAILED(hr)) return hr; VARIANT* pItemValues; hr=widlUnmarshal (&pItemValues, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.variant_t (), NDR_SIZEOF(VARIANT)))); if (FAILED(hr)) return hr; HRESULT* ppErrors_tmp; HRESULT** ppErrors = &ppErrors_tmp; hrMethod = pitf->Write (dwCount, phServer, pItemValues, ppErrors); NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&ppErrors, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT), dwCount)))); if (FAILED(hr)) return hr; hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; if ((*ppErrors)) {CoTaskMemFree ((*ppErrors));}; return S_OK; }COM_VTABLE(IOPCSyncIO) IOPCSyncIO_vxproxy_vtbl = { COM_VTBL_HEADER COM_VTBL_METHOD(&IUnknown_QueryInterface_vxproxy), COM_VTBL_METHOD(&IUnknown_AddRef_vxproxy), COM_VTBL_METHOD(&IUnknown_Release_vxproxy), COM_VTBL_METHOD(&IOPCSyncIO_Read_vxproxy), COM_VTBL_METHOD(&IOPCSyncIO_Write_vxproxy), };const PFN_ORPC_STUB stub_functbl_IOPCSyncIO [] = { 0,0,0, (PFN_ORPC_STUB) IOPCSyncIO_Read_vxstub, (PFN_ORPC_STUB) IOPCSyncIO_Write_vxstub, };EXTERN_C const VXDCOM_STUB_DISPTBL IOPCSyncIO_vxstub_disptbl = { 5, stub_functbl_IOPCSyncIO };VXDCOM_PS_AUTOREGISTER(IOPCSyncIO);HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Read_vxproxy (IOPCAsyncIO* pThis, DWORD dwConnection, OPCDATASOURCE dwSource, DWORD dwCount, OPCHANDLE* phServer, DWORD* pTransactionID, HRESULT** ppErrors) { RPC_PROXY_MSG msg (IID_IOPCAsyncIO, RpcMode::OBJECT, 3, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwConnection, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&dwSource, pms, ndrtypes.enum_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&dwCount, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&phServer, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE), dwCount))); if (FAILED(hr)) return hr; hr = msg.SendReceive (); if (FAILED (hr)) return hr; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); hr=widlUnmarshal (&pTransactionID, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr; hr=widlUnmarshal (&ppErrors, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT))))); if (FAILED(hr)) return hr; hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; return hrMethod; }HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Read_vxstub (IOPCAsyncIO* pitf, RPC_STUB_MSG& msg) { NDRTYPES ndrtypes; HRESULT hr; HRESULT hrMethod; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); DWORD dwConnection; hr=widlUnmarshal (&dwConnection, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; OPCDATASOURCE dwSource; hr=widlUnmarshal (&dwSource, pus, ndrtypes.enum_t ()); if (FAILED(hr)) return hr; DWORD dwCount; hr=widlUnmarshal (&dwCount, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; OPCHANDLE* phServer; hr=widlUnmarshal (&phServer, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE)))); if (FAILED(hr)) return hr; DWORD pTransactionID_tmp; DWORD* pTransactionID = &pTransactionID_tmp; HRESULT* ppErrors_tmp; HRESULT** ppErrors = &ppErrors_tmp; hrMethod = pitf->Read (dwConnection, dwSource, dwCount, phServer, pTransactionID, ppErrors); NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&pTransactionID, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr; hr=widlMarshal (&ppErrors, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT), dwCount)))); if (FAILED(hr)) return hr; hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; if ((*ppErrors)) {CoTaskMemFree ((*ppErrors));}; return S_OK; }HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Write_vxproxy (IOPCAsyncIO* pThis, DWORD dwConnection, DWORD dwCount, OPCHANDLE* phServer, VARIANT* pItemValues, DWORD* pTransactionID, HRESULT** ppErrors) { RPC_PROXY_MSG msg (IID_IOPCAsyncIO, RpcMode::OBJECT, 4, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwConnection, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&dwCount, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&phServer, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE), dwCount))); if (FAILED(hr)) return hr; hr=widlMarshal (&pItemValues, pms, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.variant_t (), NDR_SIZEOF(VARIANT), dwCount))); if (FAILED(hr)) return hr; hr = msg.SendReceive (); if (FAILED (hr)) return hr; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); hr=widlUnmarshal (&pTransactionID, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr; hr=widlUnmarshal (&ppErrors, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT))))); if (FAILED(hr)) return hr; hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; return hrMethod; }HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Write_vxstub (IOPCAsyncIO* pitf, RPC_STUB_MSG& msg) { NDRTYPES ndrtypes; HRESULT hr; HRESULT hrMethod; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); DWORD dwConnection; hr=widlUnmarshal (&dwConnection, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; DWORD dwCount; hr=widlUnmarshal (&dwCount, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; OPCHANDLE* phServer; hr=widlUnmarshal (&phServer, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.ulong_t (), NDR_SIZEOF(OPCHANDLE)))); if (FAILED(hr)) return hr; VARIANT* pItemValues; hr=widlUnmarshal (&pItemValues, pus, ndrtypes.refptr_t(ndrtypes.carray_t(ndrtypes.variant_t (), NDR_SIZEOF(VARIANT)))); if (FAILED(hr)) return hr; DWORD pTransactionID_tmp; DWORD* pTransactionID = &pTransactionID_tmp; HRESULT* ppErrors_tmp; HRESULT** ppErrors = &ppErrors_tmp; hrMethod = pitf->Write (dwConnection, dwCount, phServer, pItemValues, pTransactionID, ppErrors); NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&pTransactionID, pms, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr; hr=widlMarshal (&ppErrors, pms, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_t (), NDR_SIZEOF(HRESULT), dwCount)))); if (FAILED(hr)) return hr; hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; if ((*ppErrors)) {CoTaskMemFree ((*ppErrors));}; return S_OK; }HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Refresh_vxproxy (IOPCAsyncIO* pThis, DWORD dwConnection, OPCDATASOURCE dwSource, DWORD* pTransactionID) { RPC_PROXY_MSG msg (IID_IOPCAsyncIO, RpcMode::OBJECT, 5, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwConnection, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&dwSource, pms, ndrtypes.enum_t ()); if (FAILED(hr)) return hr; hr = msg.SendReceive (); if (FAILED (hr)) return hr; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); hr=widlUnmarshal (&pTransactionID, pus, ndrtypes.refptr_t(ndrtypes.ulong_t ())); if (FAILED(hr)) return hr; hr = widlUnmarshal (&hrMethod, pus, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; return hrMethod; }HRESULT STDMETHODCALLTYPE IOPCAsyncIO_Refresh_vxstub (IOPCAsyncIO* pitf, RPC_STUB_MSG& msg) { NDRTYPES ndrtypes; HRESULT hr; HRESULT hrMethod; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); DWORD dwConnection; hr=widlUnmarshal (&dwConnection, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; OPCDATASOURCE dwSource; hr=widlUnmarshal (&dwSource, pus, ndrtypes.enum_t ()); if (FAILED(hr)) return hr; DWORD pTransactionID_tmp; DWORD* pTransactionID = &pTransactionID_tmp; hrMethod = pitf->Refresh (dwConnection, dwSource, pTransactionID); NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&pTransactionID, 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 IOPCAsyncIO_Cancel_vxproxy (IOPCAsyncIO* pThis, DWORD dwTransactionID) { RPC_PROXY_MSG msg (IID_IOPCAsyncIO, RpcMode::OBJECT, 6, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwTransactionID, pms, ndrtypes.ulong_t ()); 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 IOPCAsyncIO_Cancel_vxstub (IOPCAsyncIO* pitf, RPC_STUB_MSG& msg) { NDRTYPES ndrtypes; HRESULT hr; HRESULT hrMethod; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); DWORD dwTransactionID; hr=widlUnmarshal (&dwTransactionID, pus, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hrMethod = pitf->Cancel (dwTransactionID); NdrMarshalStream* pms = msg.marshalStreamGet (); hr = widlMarshal (&hrMethod, pms, ndrtypes.hresult_t()); if (FAILED(hr)) return hr; return S_OK; }COM_VTABLE(IOPCAsyncIO) IOPCAsyncIO_vxproxy_vtbl = { COM_VTBL_HEADER COM_VTBL_METHOD(&IUnknown_QueryInterface_vxproxy), COM_VTBL_METHOD(&IUnknown_AddRef_vxproxy), COM_VTBL_METHOD(&IUnknown_Release_vxproxy), COM_VTBL_METHOD(&IOPCAsyncIO_Read_vxproxy), COM_VTBL_METHOD(&IOPCAsyncIO_Write_vxproxy), COM_VTBL_METHOD(&IOPCAsyncIO_Refresh_vxproxy), COM_VTBL_METHOD(&IOPCAsyncIO_Cancel_vxproxy), };const PFN_ORPC_STUB stub_functbl_IOPCAsyncIO [] = { 0,0,0, (PFN_ORPC_STUB) IOPCAsyncIO_Read_vxstub, (PFN_ORPC_STUB) IOPCAsyncIO_Write_vxstub, (PFN_ORPC_STUB) IOPCAsyncIO_Refresh_vxstub, (PFN_ORPC_STUB) IOPCAsyncIO_Cancel_vxstub, };EXTERN_C const VXDCOM_STUB_DISPTBL IOPCAsyncIO_vxstub_disptbl = { 7, stub_functbl_IOPCAsyncIO };VXDCOM_PS_AUTOREGISTER(IOPCAsyncIO);HRESULT STDMETHODCALLTYPE IOPCItemMgt_AddItems_vxproxy (IOPCItemMgt* pThis, DWORD dwCount, OPCITEMDEF* pItemArray, OPCITEMRESULT** ppAddResults, HRESULT** ppErrors) { RPC_PROXY_MSG msg (IID_IOPCItemMgt, RpcMode::OBJECT, 3, pThis); NDRTYPES ndrtypes; HRESULT hrMethod; HRESULT hr; NdrMarshalStream* pms = msg.marshalStreamGet (); hr=widlMarshal (&dwCount, pms, ndrtypes.ulong_t ()); if (FAILED(hr)) return hr; hr=widlMarshal (&pItemArray, pms, ndrtypes.refptr_t(ndrtypes.carray_t(StructDesc_tagOPCITEMDEF (ndrtypes), NDR_SIZEOF(OPCITEMDEF), dwCount))); if (FAILED(hr)) return hr; hr = msg.SendReceive (); if (FAILED (hr)) return hr; NdrUnmarshalStream* pus = msg.unmarshalStreamGet (); hr=widlUnmarshal (&ppAddResults, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(StructDesc_tagOPCITEMRESULT (ndrtypes), NDR_SIZEOF(OPCITEMRESULT))))); if (FAILED(hr)) return hr; hr=widlUnmarshal (&ppErrors, pus, ndrtypes.refptr_t(ndrtypes.pointer_t(ndrtypes.carray_t(ndrtypes.long_
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -