Technical Standard IPC Mechanisms For
Total Page:16
File Type:pdf, Size:1020Kb
Technical Standard IPC Mechanisms for SMB NICAL H S C T A E N T D A R D [This page intentionally left blank] X/Open CAE Specification IPC Mechanisms for SMB X/Open Company Ltd. December 1991, X/Open Company Limited All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owners. X/Open CAE Specification IPC Mechanisms for SMB ISBN: 1 872630 28 6 X/Open Document Number: XO/CAE/91/500 Published by X/Open Company Ltd., U.K. Any comments relating to the material contained in this document may be submitted to X/Open at: X/Open Company Limited Apex Plaza Forbury Road Reading Berkshire, RG1 1AX United Kingdom or by Electronic Mail to: [email protected] ii X/Open CAE Specification (1991) Contents Chapter 1 Introduction............................................................................................... 1 Chapter 2 SMB IPC Service Model .................................................................... 3 2.1 Security Overview ...................................................................................... 3 2.2 Naming ......................................................................................................... 4 2.2.1 Named Pipe and Mailslot Names ........................................................ 4 2.2.2 NetBIOS Names ....................................................................................... 4 2.2.3 Messaging Names.................................................................................... 5 2.2.4 Name Ownership..................................................................................... 5 2.3 Mailslot Service Model .............................................................................. 6 2.3.1 Distributed Computing Model ............................................................. 6 2.3.2 Naming ...................................................................................................... 6 2.3.3 Security ...................................................................................................... 6 2.3.4 Inheritance................................................................................................. 6 2.3.5 Process Termination ................................................................................ 6 2.3.6 API Summary ........................................................................................... 7 2.3.7 Sample Mailslot Communication Scenario........................................ 7 2.4 Named Pipe Service Model ...................................................................... 8 2.4.1 Distributed Computing Model ............................................................. 8 2.4.2 Naming ...................................................................................................... 8 2.4.3 Security ...................................................................................................... 8 2.4.4 Pipe Instances and Inheritance ............................................................. 9 2.4.5 Process Termination ................................................................................ 9 2.4.6 Modes......................................................................................................... 9 2.4.7 API Summary ........................................................................................... 10 2.4.8 States........................................................................................................... 10 2.4.9 Sample Named Pipe Communication Scenario ................................ 13 2.5 Messaging Service Model.......................................................................... 14 2.5.1 Basic Model of the Messaging Service................................................. 14 2.5.2 Naming ...................................................................................................... 14 2.5.3 Security ...................................................................................................... 14 2.5.4 Sample Messaging Communication Scenario ................................... 14 2.5.5 API Summary ........................................................................................... 14 Chapter 3 Application Programming Interfaces ........................................ 15 3.1 Introduction ................................................................................................. 15 3.2 Include Files ................................................................................................. 15 <lmerror.h> ...................................................................................................... 16 <mailslot.h>...................................................................................................... 18 <message.h>...................................................................................................... 19 <nmpipe.h>....................................................................................................... 20 3.3 Mailslots........................................................................................................ 21 IPC Mechanisms for SMB iii Contents DosDeleteMailslot( ) ........................................................................................ 22 DosMailslotInfo ( )............................................................................................ 23 DosMakeMailslot( ) ......................................................................................... 25 DosPeekMailslot( ) ........................................................................................... 27 DosReadMailslot( ) .......................................................................................... 29 DosWriteMailslot( ) ......................................................................................... 31 3.4 Named Pipes................................................................................................ 33 3.4.1 Named Pipe States................................................................................... 33 DosBufReset( ) .................................................................................................. 34 DosCallNmPipe( ) ............................................................................................ 35 DosClose( )........................................................................................................ 37 DosConnectNmPipe( ) ..................................................................................... 38 DosDisconnectNmPipe( ) ................................................................................ 40 DosDupHandle( ) ............................................................................................. 41 DosMakeNmPipe( ).......................................................................................... 42 DosOpen( )........................................................................................................ 45 DosPeekNmPipe( )............................................................................................ 47 DosQFHandState( ) ......................................................................................... 49 DosQNmpHandState( ) ................................................................................... 50 DosQNmPipeInfo( ) ......................................................................................... 52 DosRead( )......................................................................................................... 54 DosSetFHandState( ) ....................................................................................... 56 DosSetNmpHandState( ) ................................................................................. 57 DosTransactNmPipe( )..................................................................................... 58 DosWaitNmPipe( ) ........................................................................................... 60 DosWrite( )........................................................................................................ 61 LmForkNmPipe( )............................................................................................. 63 3.5 Messaging..................................................................................................... 64 NetMessageBufferSend( )................................................................................. 65 Chapter 4 Transmission Analysis ....................................................................... 67 4.1 Mailslots........................................................................................................ 67 4.1.1 Introduction.............................................................................................. 67 4.1.2 DosDeleteMailslot( )................................................................................ 69 4.1.3 DosMailslotInfo( ) .................................................................................... 70 4.1.4 DosMakeMailslot() ................................................................................. 71 4.1.5 DosPeekMailslot( )................................................................................... 72 4.1.6 DosReadMailslot( ) .................................................................................. 73 4.1.7 DosWriteMailslot( ).................................................................................. 74 4.2 Named Pipes...............................................................................................