/***************************************************************************** Copyright (c) netsecsp 2012-2032, All rights reserved. Developer: Shengqian Yang, from China, E-mail: netsecsp@hotmail.com, last updated 05/01/2022 http://asynframe.sf.net Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ import "IAsynFileSystem.idl"; cpp_quote("#pragma pack(push, 1)") interface IAsynIpcDeviceListener; interface IAsynIpcDevice; interface IAsynNamedPipe; ///////////////////////////////////////////////////////////////////////////// [ object, uuid(63A88D82-1EB4-45a1-847D-0F2AE3D54D06), helpstring("IAsynIpcIoOperation Interface"), pointer_default(unique) ] interface IAsynIpcIoOperation : IAsynIoOperation { HRESULT GetPeerAddress( [in ]IStringSetter* Name, [out]uint32_t* pid ); HRESULT SetPeerAddress( [in ]STRING Name, [in ]uint32_t pid ); }; [// 匿名管道是通过系统自动分配一个唯一的管道名字来创建的。 object, uuid(852F8BD3-2CC0-40c4-8156-6AF0735FFCBD), helpstring("IAsynNamedPipe Interface"), pointer_default(unique) ] interface IAsynNamedPipe : IAsynIoDevice { //返 回 值:S_OK -成功执行Open // S_FALSE-已经Open,执行Open失败 // 其他值表示出错 HRESULT Open( [in ]IAsynFrameThread* pAsynFrameThread, [in ]STRING PipeName, [in ]uint32_t lOpenMode, [in ]BOOL bIsStream, [in ]uint32_t lMaxInstances, [in ]uint32_t lOutBufferSize, [in ]uint32_t lInBufferSize, [in ]uint32_t lDefaultTimeOut, [in ]handle pSecurityAttributes ); ///////////////////////////////////////////////////////////////////////// HRESULT Accept( [in ]IAsynIoOperation* pAsynIoOperation ); }; [// 模拟面向连接的Udp数据包传输方式, 读IAsynIoOperation无需分配IoBuffer,lParam1参数由对端Write的lParam1参数决定 object, uuid(EB387F4A-854B-41f2-B92A-0C80E2E44515), helpstring("IAsynIpcDevice Interface"), pointer_default(unique) ] interface IAsynIpcDevice : IAsynIoDevice { //注意参数:pAsynIoOperation必须是IAsynIpcIoOperation类型 HRESULT Connect( [in ]IAsynFrameThread* pAsynFrameThread, [in ]STRING IpcName, [in ]uint32_t lDstProcessId, [in ]IAsynIoOperation* pAsynIoOperation, [in ]uint32_t lTimeoutms ); }; [// 模拟面向连接的Udp数据包传输方式, 读IAsynIoOperation无需分配IoBuffer,lParam1参数由对端Write的lParam1参数决定 object, uuid(9ED3FDED-C662-4d3c-A951-29E7FDEDADAF), helpstring("IAsynIpcDeviceListener Interface"), pointer_default(unique) ] interface IAsynIpcDeviceListener : IAsynIoDevice { HRESULT Open( [in ]IAsynFrameThread* pAsynFrameThread, [in ]STRING IpcName ); ///////////////////////////////////////////////////////////////////////// //注意参数:pAsynIoOperation必须是IAsynIpcIoOperation类型 HRESULT Accept( [in ]IAsynIoOperation* pAsynIoOperation ); }; ///////////////////////////////////////////////////////////////////////////// [// 没有继承:IObjectHolder, 注意:依赖IAsynFileSystem object, uuid(D453C04E-A8E6-4d8d-B024-442365E86B85), helpstring("IAsynIpcChannel Interface"), pointer_default(unique) ] interface IAsynIpcChannel : IAsynIoOperationFactory { HRESULT CreateAsynNamedPipe( [out]IAsynNamedPipe** ppAsynNamedPipe ); ///////////////////////////////////////////////////////////////////////// HRESULT CreateAsynIpcDevice( [out]IAsynIpcDevice** ppAsynIpcDevice ); //注意参数:keepalive=10用于建立连接后,用心跳检测对端进程是否已经假死,keepalive=0表示不用心跳检测,单位:100毫秒 HRESULT CreateAsynIpcDeviceListener( [in ]STRING argv/*默认等于null*/, [out]IAsynIpcDeviceListener** ppAsynIpcDeviceListener ); }; cpp_quote("#pragma pack(pop)")