## Printer Device Driver

[prev][next][parent][TOC]

### Changing Global Semaphore Name

The Omni driver utilizes a named global semaphore that should remain unique within the operating system. If you do not change this semaphore name, the drivers can attempt to use the same semaphore name at the same time which will lock (deadlock) the operating system. The printer driver is a "trusted " extension of the base operating system and should behave with multi- tasking in mind.

To change the Omni driver's global semaphore name, do the following:

1.Look for the following lines in the driver.c file that define Omni's global data:

          GLOBALS  globals =
          {
            0L,
            (HMODULE) 0,                    // supplied on first load in INITTERM.C
            ....,
          #ifndef DDKBLD
            "\\SEM32\\OMNI\\GLOBAL\\SEM",   // pointer to string containing the name
                                            // of the global sem (OMNI)
          #else
            "\\SEM32\\SAMP\\GLOBAL\\SEM",   // pointer to string containing the name
          #endif                            // of the global sem (DDK)

          };

2.Replace the line between the #else and the #endif line with a semaphore name that will be unique to your driver. The easiest do this is to replace the portion of the name that reads "SAMP" with the name of your new driver.