Microsoft KB Archive/69017

INF: Attaching User Defined Data to a DBPROCESS

PSS ID Number: Q69017 Article last modified on 02-03-1994

1.10 OS/2

Question
Is there a way to attach a piece of user (programmer) defined data to a DBPROCESS (something like WinSetWindowUlong)? All I need is one LONG or PVOID. I have an application with many DBPROCESSs. In the error/message handlers section of the program, I have no way of finding other application-specific data that is directly associated with a particular DBPROCESS. Also, I found that SQL Server version 1.10 does not include the DBPROCESS structure in the ''.H files. Is the structure in SQL Server version 1.10 compatible with the structure included with the SQL Server version 1.00 ''.H files?

Response
We suggest that you keep a table of pairs of pointers connecting the DBPROCESS and your data pointers in your application so that you can go back and forth between a DBPROCESS pointer and your own data. If you have too many DBPROCESSs, then you can use a hash table. This is the cleanest solution, and will work with all versions of SQL Server on all platforms. The DBPROCESS structure included with SQL Server version 1.10 is different than the version of this structure included with version 1.00 of SQL Server. There is no guarantee that the structure will remain the same between different versions of SQL Server.

=
================================================================ Copyright Microsoft Corporation 1994.