비동기 파이프 선언
다음 예제 IDL 파일은 일반적인 파이프 구조와 파이프가 있는 비동기 RPC 함수를 정의합니다.
예제
//file: Xasyncpipe.idl:
//
interface IMyAsyncPipe
{
//define the pipe type
typedef pipe int aysnc_intpipe ;
//then use it as a parameter
int MyAsyncPipe(
handle_t hBinding,
[in] a,
[in] ASYNC_INTPIPE *inpipe,
[out] ASYNC_INTPIPE *outpipe,
[out] int *b) ;
};
//other function declarations
//other interface definitions
//end Xasyncpipe.idl
//file:Xasyncpipe.acf:
//file: Xasyncpipe.acf:
interface IMyAsyncPipe
{
[async] MyAsyncPipe () ;
} ;
//
//end Xasyncpipe.acf
다음 코드 조각은 일반적인 파이프 구조 정의를 보여줍니다. 여기에는 푸시 및 끌어오기 프로시저에 대한 포인터, 파이프 데이터를 저장할 버퍼 및 프로시저를 조정하는 상태 변수가 포함됩니다.
//
typedef struct ASYNC_MYPIPE
{
RPC_STATUS (__RPC_FAR * pull) (
char __RPC_FAR * state,
small __RPC_FAR * buf,
unsigned long esize,
unsigned long __RPC_FAR * ecount );
RPC_STATUS (__RPC_FAR * push) (
char __RPC_FAR * state,
small __RPC_FAR * buf,
unsigned long ecount );
void *Reserved;
char __RPC_FAR * state;
}ASYNC_INTPIPE;