pipemode (ULONG) - input

      A set of flags defining the mode of the pipe.

      This parameter contains the following bit fields:

      Bit

        Description
      31-16
        Reserved.
      15
        Blocking mode. Blocking mode is defined as either "blocking" or "nonblocking," as follows:

      • NP_WAIT (0x0000)
        Blocking mode: DosRead and DosWrite block if no data is available.

      • NP_NOWAIT = NP_NBLK (0x8000)
        Nonblocking mode: DosRead and DosWrite return immediately if no data is available.

        DosRead normally blocks until at least partial data can be returned. DosWrite blocks by default until all of the requested bytes have been written. Nonblocking mode changes this behavior as following:

        DosRead returns immediately with ERROR_NO_DATA if no data is available.

        DosWrite returns immediately with a value of 0 for pcbActual if there is not enough buffer space available in the pipe; otherwise, the entire data area is transferred.

      14-12
        Reserved.
      11-10
        Type of named pipe. The pipe type is defined as follows:

        00

          NP_TYPE_BYTE (0x0000)
          The pipe is a byte pipe; that is, data is written to the pipe as an undifferentiated stream of bytes.
        01
          NP_TYPE_MESSAGE = NP_WMESG (0x0400)
          The pipe is a message pipe; that is, data is written to the pipe as messages. The system records the length of each message in the first two bytes of the message, which are called the message header. A header of all zeroes is reserved, and zero-length messages are not allowed.
        9-8
          Read mode. The read mode is defined as follows:

          00

            NP_READMODE_BYTE (0x0000)
            Byte-read mode: Read the pipe as a byte stream.
          01
            NP_READMODE_MESSAGE = NP_RMESG (0x0100)
            Message-read mode: Read the pipe as a message stream.
          Message pipes can be read as either byte streams or message streams, depending on the value of this bit. Byte pipes can be read only as byte streams.
        7-0
          ICount (Instance count). When the first instance of a named pipe is created, ICount specifies how many instances (including the first instance) may be created. Possible values are shown in the following list:

        • This is the only instance permitted (the pipe is unique).

        • < value < 255
            The number of instances is limited to the value specified.
          -1
            NP_UNLIMITED_INSTANCES (0x00FF)
            The number of instances is unlimited.
          0
            Reserved value.
          ICount is ignored when specifying any instance of a pipe other than the first one. Subsequent attempts to create a pipe instance fail if the maximum number of allowed instances already exists. When multiple instances are allowed, multiple clients can simultaneously open the same pipe name; they will receive handles to distinct pipe instances.


        [Back] [Next]