Opens the specified device or application console.
#include <nks/fsio.h> int NXDeviceOpen ( NXPathCtx_t pathCtx, const void *name, NXMode_t mode, NXShareMode_t shareMode, unsigned long flags, size_t *ioBlockSize, NXHandle_t *deviceHandle);
(IN) Specifies a file system path context. Along with the pathname parameter, it specifies the device to open. This parameter is not used for a console.
(IN) Points to a null-terminated Unicode or ASCII string that specifies the name of the device or console to open. For a console, this becomes the name displayed at the top of the screen.
(IN) Specifies whether the device or console is to be opened for reading, writing, or both. See NKS Open Modes.
(IN) Specifies the share mode flags. See Shared Modes. This parameter is not used for a console.
(IN) Pass 0.
(OUT) Points to the block size for I/O operations. This parameter is not used for a console.
(OUT) Points to the file descriptor on which the device can be read or written.
If successful, returns 0, and in the deviceHandle parameter, a handle to the device. Otherwise, returns a nonzero error code and -1 in the deviceHandle parameter:
NXDeviceOpen creates a handle and associates it with a device or console. If zero is returned in the ioBlockSize parameter, any size can be used. Otherwise, I/O operations must use multiples of the returned block size.
Currently on NetWare, this function can be used to open a console or a FIFO. Each of these devices have a macro, based on NXDeviceOpen and designed especially for that type of device: NXConsoleOpen and NXFifoOpen.
NOTE:If your NLM has already created an application screen, the pathname parameter is ignored and the deviceHandle parameter returns a handle to the already created screen.