## Virtual Device Driver Reference for OS/2

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

### VDHQuerySel - Purpose

Context Issues: This function can be called in the initialization and task context:

During initialization time; query is allowed only on initialization and global data.
Global, instance, and stack data are allowed during task time (typically DOS session creation time), but initialization data is not.

DOS Session Terminations: Selectors for virtual device driver instance data are destroyed when the DOS session terminates. The virtual device driver must ensure that any physical device driver that was given this kind of selector is finished with it.

Notes: This function works only on 0:32 addresses in virtual device driver data objects and stacks. Each virtual device driver data object is limited to a maximum of 64KB in size so that the following formula can be used. A virtual device driver that needs more than 64KB of a particular class (INIT , global, or instance) must use multiple objects.

Notice that the selectors for virtual device driver data are created to map starting at a 64KB linear address boundary. As a result, VDHQuerySel needs to be called only once. The returned selector is valid for any memory in the particular object that contains the passed address, because the DOS Session Manager does not allow a virtual device driver data object to span a 64KB linear address boundary.

For virtual device driver instance data, this function returns a different GDT selector for each DOS session, and it can be called only in the context of a DOS session.