🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer.misc
Article #186

Dos16MonReg() error: why?

#186
From: 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
Technical Details
Message-ID: <3ngt6l$r9u@cpcug.org>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cd94,9f5787807f583afe,start
X-Google-Attributes: gid10cd94,public
X-Google-Thread: 11307a,9f5787807f583afe,start
X-Google-Attributes: gid11307a,public
From: kbennett@cpcug.org (Keith Bennett)
Subject: Dos16MonReg() error: why?
Date: 1995/04/24
Message-ID: <3ngt6l$r9u@cpcug.org>
X-Deja-AN: 101477393
organization: Express Access Online Communications USA: 800-969-9090
newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l