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

📄 opc_ae_p.c

📁 OPC客户程序所需要的头文件。 OPC基金会产品。 适用于opc1.0和opc2.0规范。
💻 C
📖 第 1 页 / 共 5 页
字号:
        *(( DWORD __RPC_FAR * )_StubMsg.Buffer)++ = *pdwCount;
        
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppdwAttrIDs,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[84] );
        
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppszAttrDescs,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[102] );
        
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppvtAttrTypes,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[144] );
        
        _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
        
        }
    RpcFinally
        {
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerFree( &_StubMsg,
                        (unsigned char __RPC_FAR *)ppdwAttrIDs,
                        &__MIDL_TypeFormatString.Format[84] );
        
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerFree( &_StubMsg,
                        (unsigned char __RPC_FAR *)ppszAttrDescs,
                        &__MIDL_TypeFormatString.Format[102] );
        
        _StubMsg.MaxCount = pdwCount ? *pdwCount : 0;
        
        NdrPointerFree( &_StubMsg,
                        (unsigned char __RPC_FAR *)ppvtAttrTypes,
                        &__MIDL_TypeFormatString.Format[144] );
        
        }
    RpcEndFinally
    _pRpcMessage->BufferLength = 
        (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
    
}


HRESULT STDMETHODCALLTYPE IOPCEventServer_TranslateToItemIDs_Proxy( 
    IOPCEventServer __RPC_FAR * This,
    /* [in] */ LPWSTR szSource,
    /* [in] */ DWORD dwEventCategory,
    /* [in] */ LPWSTR szConditionName,
    /* [in] */ LPWSTR szSubconditionName,
    /* [in] */ DWORD dwCount,
    /* [size_is][in] */ DWORD __RPC_FAR *pdwAssocAttrIDs,
    /* [size_is][size_is][out] */ LPWSTR __RPC_FAR *__RPC_FAR *ppszAttrItemIDs,
    /* [size_is][size_is][out] */ LPWSTR __RPC_FAR *__RPC_FAR *ppszNodeNames,
    /* [size_is][size_is][out] */ CLSID __RPC_FAR *__RPC_FAR *ppCLSIDs)
{

    HRESULT _RetVal;
    
    RPC_MESSAGE _RpcMessage;
    
    MIDL_STUB_MESSAGE _StubMsg;
    
    *ppszAttrItemIDs = 0;
    *ppszNodeNames = 0;
    *ppCLSIDs = 0;
    RpcTryExcept
        {
        NdrProxyInitialize(
                      ( void __RPC_FAR *  )This,
                      ( PRPC_MESSAGE  )&_RpcMessage,
                      ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                      ( PMIDL_STUB_DESC  )&Object_StubDesc,
                      11);
        
        
        
        RpcTryFinally
            {
            
            _StubMsg.BufferLength = 12U + 10U + 14U + 14U + 10U + 7U;
            NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                           (unsigned char __RPC_FAR *)szSource,
                                           (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                           (unsigned char __RPC_FAR *)szConditionName,
                                           (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                           (unsigned char __RPC_FAR *)szSubconditionName,
                                           (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            _StubMsg.MaxCount = dwCount;
            
            NdrConformantArrayBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                          (unsigned char __RPC_FAR *)pdwAssocAttrIDs,
                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[166] );
            
            NdrProxyGetBuffer(This, &_StubMsg);
            NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                                         (unsigned char __RPC_FAR *)szSource,
                                         (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            *(( DWORD __RPC_FAR * )_StubMsg.Buffer)++ = dwEventCategory;
            
            NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                                         (unsigned char __RPC_FAR *)szConditionName,
                                         (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                                         (unsigned char __RPC_FAR *)szSubconditionName,
                                         (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142] );
            
            _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            *(( DWORD __RPC_FAR * )_StubMsg.Buffer)++ = dwCount;
            
            _StubMsg.MaxCount = dwCount;
            
            NdrConformantArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                                        (unsigned char __RPC_FAR *)pdwAssocAttrIDs,
                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[166] );
            
            NdrProxySendReceive(This, &_StubMsg);
            
            if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
                NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[100] );
            
            NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                  (unsigned char __RPC_FAR * __RPC_FAR *)&ppszAttrItemIDs,
                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176],
                                  (unsigned char)0 );
            
            NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                  (unsigned char __RPC_FAR * __RPC_FAR *)&ppszNodeNames,
                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176],
                                  (unsigned char)0 );
            
            NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                  (unsigned char __RPC_FAR * __RPC_FAR *)&ppCLSIDs,
                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[214],
                                  (unsigned char)0 );
            
            _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
            
            }
        RpcFinally
            {
            NdrProxyFreeBuffer(This, &_StubMsg);
            
            }
        RpcEndFinally
        
        }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
        {
        _StubMsg.MaxCount = dwCount;
        
        NdrClearOutParameters(
                         ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                         ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[176],
                         ( void __RPC_FAR * )ppszAttrItemIDs);
        _StubMsg.MaxCount = dwCount;
        
        NdrClearOutParameters(
                         ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                         ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[176],
                         ( void __RPC_FAR * )ppszNodeNames);
        _StubMsg.MaxCount = dwCount;
        
        NdrClearOutParameters(
                         ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                         ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[214],
                         ( void __RPC_FAR * )ppCLSIDs);
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
        }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IOPCEventServer_TranslateToItemIDs_Stub(
    IRpcStubBuffer *This,
    IRpcChannelBuffer *_pRpcChannelBuffer,
    PRPC_MESSAGE _pRpcMessage,
    DWORD *_pdwStubPhase)
{
    LPWSTR __RPC_FAR *_M40;
    LPWSTR __RPC_FAR *_M41;
    CLSID __RPC_FAR *_M42;
    HRESULT _RetVal;
    MIDL_STUB_MESSAGE _StubMsg;
    DWORD dwCount;
    DWORD dwEventCategory;
    DWORD __RPC_FAR *pdwAssocAttrIDs;
    CLSID __RPC_FAR *__RPC_FAR *ppCLSIDs;
    LPWSTR __RPC_FAR *__RPC_FAR *ppszAttrItemIDs;
    LPWSTR __RPC_FAR *__RPC_FAR *ppszNodeNames;
    LPWSTR szConditionName;
    LPWSTR szSource;
    LPWSTR szSubconditionName;
    
NdrStubInitialize(
                     _pRpcMessage,
                     &_StubMsg,
                     &Object_StubDesc,
                     _pRpcChannelBuffer);
    szSource = 0;
    szConditionName = 0;
    szSubconditionName = 0;
    pdwAssocAttrIDs = 0;
    ppszAttrItemIDs = 0;
    ppszNodeNames = 0;
    ppCLSIDs = 0;
    RpcTryFinally
        {
        if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
            NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[100] );
        
        NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                       (unsigned char __RPC_FAR * __RPC_FAR *)&szSource,
                                       (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142],
                                       (unsigned char)0 );
        
        _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        dwEventCategory = *(( DWORD __RPC_FAR * )_StubMsg.Buffer)++;
        
        NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                       (unsigned char __RPC_FAR * __RPC_FAR *)&szConditionName,
                                       (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142],
                                       (unsigned char)0 );
        
        NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                       (unsigned char __RPC_FAR * __RPC_FAR *)&szSubconditionName,
                                       (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[142],
                                       (unsigned char)0 );
        
        _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        dwCount = *(( DWORD __RPC_FAR * )_StubMsg.Buffer)++;
        
        NdrConformantArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
                                      (unsigned char __RPC_FAR * __RPC_FAR *)&pdwAssocAttrIDs,
                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[166],
                                      (unsigned char)0 );
        
        ppszAttrItemIDs = &_M40;
        _M40 = 0;
        ppszNodeNames = &_M41;
        _M41 = 0;
        ppCLSIDs = &_M42;
        _M42 = 0;
        
        *_pdwStubPhase = STUB_CALL_SERVER;
        _RetVal = (((IOPCEventServer *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> TranslateToItemIDs(
                      (IOPCEventServer *) ((CStdStubBuffer *)This)->pvServerObject,
                      szSource,
                      dwEventCategory,
                      szConditionName,
                      szSubconditionName,
                      dwCount,
                      pdwAssocAttrIDs,
                      ppszAttrItemIDs,
                      ppszNodeNames,
                      ppCLSIDs);
        
        *_pdwStubPhase = STUB_MARSHAL;
        
        _StubMsg.BufferLength = 8U + 14U + 14U + 7U;
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                              (unsigned char __RPC_FAR *)ppszAttrItemIDs,
                              (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176] );
        
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                              (unsigned char __RPC_FAR *)ppszNodeNames,
                              (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176] );
        
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
                              (unsigned char __RPC_FAR *)ppCLSIDs,
                              (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[214] );
        
        _StubMsg.BufferLength += 16;
        
        NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppszAttrItemIDs,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176] );
        
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppszNodeNames,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[176] );
        
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
                            (unsigned char __RPC_FAR *)ppCLSIDs,
                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[214] );
        
        _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
        
        }
    RpcFinally
        {
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerFree( &_StubMsg,
                        (unsigned char __RPC_FAR *)ppszAttrItemIDs,
                        &__MIDL_TypeFormatString.Format[176] );
        
        _StubMsg.MaxCount = dwCount;
        
        NdrPointerFree( &_StubMsg,
                        (unsigned char __RPC_FAR *)ppszNodeNames,
                        &__MIDL_TypeFormatString.Format[176] );
        
  

⌨️ 快捷键说明

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