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

Last reviewed: April 25, 1997
Article ID: 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 TSR 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 terminate-and-stay-resident (TSR) program installs itself. It then compares 9 bytes from that address, after an initial offset of 2 bytes, to "DBLIBRARY". If the TSR program is loaded, these bytes will match.

#include <dos.h>
#include <memory.h>
#include <stdio.h>

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,"DBLIBRARY",9);
    if (result == 0)
        printf("\nDBNMPIPE is loaded\n");
    else
        printf("\nDBNMPIPE is not loaded\n");
}


Additional query words: dblib DBNMPIPE TSR
Keywords : kbprg SSrvDB_Lib
Version : 4.2
Platform : MS-DOS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.