🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer.misc
1 messages
1 total messages Started by Keith Bennett Mon, 24 Apr 1995 00:00
Dos16MonReg() error: why?
#186
Author: Keith Bennett
Date: Mon, 24 Apr 1995 00:00
53 lines
2309 bytes
What can cause DosMonReg (Dos16MonReg) to fail?  It works fine in
most programs I include it in, but in one, it fails with an error
code of 379 (ERROR_MON_INVALID_PARMS).  I have inspected the values
I'm passing in the programs, and they all seem to be the same.
Nevertheless, the error occurs in one program but not others.

Also, I'm making the actual DosMon calls in a DLL which is shared
by the programs that work and the one that doesn't.  So the code is
identical.

DosMonOpen() always returns 0, indicating success.  The handle's value
is always 5.  I'm always using LPT1.

I create chain buffers of 4096 bytes each, and place the length in
the first 2 bytes of the buffer.  Then I create a new MONITORPACKET
and call Dos16MonOpen() and Dos16MonReg():
-------
	enum { CHAINSIZE = 4096; };

	chain_input_buf  = new UCHAR [CHAINSIZE];
	chain_output_buf = new UCHAR [CHAINSIZE];

	if( chain_input_buf && chain_output_buf)
	{
		USHORT *input_buf_size   = (USHORT *) chain_input_buf;
		USHORT *output_buf_size  = (USHORT *) chain_output_buf;

		*input_buf_size = *output_buf_size = CHAINSIZE;

		p_monitor_packet = new MONITORPACKET;
	} // else barf and return

	//  ...
	APIRET16 rc = Dos16MonOpen( sysname, &handle_monitor);
	if( rc) ...

	rc = Dos16MonReg(
		handle_monitor, chain_input_buf, chain_output_buf,
		PLACE_END_CHAIN, PARALLEL_DATA_CHAIN);
	if( rc) // This is where I get the error (#379)
		...

--------

Any suggestions *greatly* appreciated.

- Keith

-- 
--------------------------------------------------------------------------
Keith Bennett                             Bennett Business Solutions, Inc.
Silver Spring, MD USA                     OS/2 & DOS Software Development
kbennett@cpcug.org                        (301) 871-7696
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads