Microsoft KB Archive/66677

{|
 * width="100%"|

INF: How to Determine if DBNMPIPE.EXE Is Loaded from C Program

 * }

Q66677

-

The information in this article applies to:


 * Microsoft SQL Server Programmer's Toolkit, version 4.2

-

SUMMARY
This article discusses how a DB-Library (DB-Lib) application can determine whether the Dbnmpipe.exe terminate-and-stay-resident (TSR) program is loaded.

MORE INFORMATION
The following program uses Interrupt 21h Function 35H to find the address of the current interrupt handler for Interrupt 62h, where the Dbnmpipe.exe TSR program installs itself. It then compares 9 bytes from that address, after an initial offset of 2 bytes, to &quot;DBLIBRARY&quot;. If the TSR program is loaded, these bytes will match.

#include 
 * 1) include 
 * 2) include 

void main(void) { union REGS inregs, outregs; struct SREGS segregs; int result; char *ptr;

inregs.h.ah = 0x35; inregs.h.al = 0x62; result = int86x(0x21,&inregs,&outregs,&segregs); FP_OFF(ptr) = outregs.x.bx + 2; FP_SEG(ptr) = segregs.es; result = memcmp((char *)ptr,&quot;DBLIBRARY&quot;,9); if (result == 0) printf(&quot;\nDBNMPIPE is loaded\n&quot;); else printf(&quot;\nDBNMPIPE is not loaded\n&quot;); } Additional query words: dblib DBNMPIPE TSR

Keywords : kbprogramming

Issue type :

Technology : kbSQLServSearch kbAudDeveloper kbSQLServPTK420