home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / docs / apdgbase.inf (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1994-03-07  |  591.9 KB  |  15,085 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. OS/2 2.0 Overview ΓòÉΓòÉΓòÉ
  3.  
  4. This chapter describes: 
  5.  
  6. o Highlights of OS/2* 2.0* 
  7.  
  8. o Benefits of OS/2 2.0 and the Presentation Manager* (PM) program 
  9.  
  10. o Concepts of the base operating system 
  11.  
  12. o Concepts of PM 
  13.  
  14. o Concepts of the Graphics Programming Interface 
  15.  
  16.  
  17. ΓòÉΓòÉΓòÉ 1.1. OS/2 2.0 Highlights ΓòÉΓòÉΓòÉ
  18.  
  19. OS/2 2.0 is an advanced multitasking, single-user operating system for personal 
  20. computers.  Like previous versions of the operating system, OS/2 2.0 provides 
  21. an application programming interface (API) that supports multitasking, multiple 
  22. threads, dynamic linking, inter-process communication, a graphical user 
  23. interface, and a graphics programming interface.  Features available in 
  24. previous versions of the operating system, such as a high-performance file 
  25. system, extended file attributes, and long file names, also are available in 
  26. OS/2 2.0. 
  27.  
  28. New features of OS/2 2.0 include: 
  29.  
  30. o Full use of the the Intel** 80386 processor features, such as flat memory 
  31.   modeling, paged virtual memory, and enhanced instruction set 
  32.  
  33. o Portability between different processing platforms 
  34.  
  35. o Full compatibility with Version 1.X 
  36.  
  37. o Execution of multiple DOS sessions 
  38.  
  39. o Virtual device drivers for supporting virtual devices to the DOS environment 
  40.  
  41.  
  42. ΓòÉΓòÉΓòÉ 1.1.1. 386 Features ΓòÉΓòÉΓòÉ
  43.  
  44. Unlike previous versions of the operating system, OS/2 2.0 takes advantage of 
  45. features of the Intel 80386 processor, such as the flat memory model, paged 
  46. virtual memory, and enhanced instruction set. This means that OS/2 applications 
  47. do not manipulate selectors and offsets as they do in the segment memory model 
  48. of previous versions of the operating system.  Instead, OS/2 2.0 applications 
  49. view memory as a large, linear, address space addressable by 32-bit offsets 
  50. from the beginning of memory.  Paged virtual memory means that memory is 
  51. managed more efficiently, and the enhanced instruction set lets the application 
  52. handle 32-bit values in single instructions. 
  53.  
  54.  
  55. ΓòÉΓòÉΓòÉ 1.1.2. Portability ΓòÉΓòÉΓòÉ
  56.  
  57. A benefit of the flat memory architecture of OS/2 2.0 is application and 
  58. operating-system portability.  Programs written for other operating systems 
  59. that use a 32-bit, linear (flat) memory model are easily portable to OS/2 2.0. 
  60. OS/2 applications that use the linear memory model will also be easily portable 
  61. to future versions of OS/2 2.0 (and other operating systems) that run under 
  62. other microprocessors.  The flat model architecture is easily portable to most 
  63. processing platforms, because hardware must provide only a base register 
  64. capable of addressing a large-paged linear address space and an offset register 
  65. for indexing into the address space.  OS/2 2.0 was not designed to be 
  66. 386-specific, but rather a 32-bit OS/2 operating system implemented on the 
  67. 80386 platform. 
  68.  
  69.  
  70. ΓòÉΓòÉΓòÉ 1.1.3. Compatibility with Version 1.X ΓòÉΓòÉΓòÉ
  71.  
  72. OS/2 2.0 requires the features of the 80386; it does not run on computers that 
  73. use the Intel 80286 processor.  This means that applications developed for OS/2 
  74. 2.0 cannot run under Version 1.X of the operating system.  However, 
  75. applications developed for Version 1.X can run under OS/2 2.0, although they 
  76. won't be able to take advantage of the full features and performance of the 
  77. operating system. 
  78.  
  79. Although OS/2 2.0 provides a complete set of 32-bit functions, the operating 
  80. system supports calls to 16-bit functions.  This means that some 32-bit 
  81. functions are converted by the system to 16-bit functions. The code that does 
  82. the converting is called the thunk layer. The thunk layer converts 32-bit 
  83. parameters to 16-bits, and maps linear addresses to segmented addresses.  The 
  84. functions of the thunk layer are transparent to application developers, and 
  85. should be of no concern unless you want to develop your own thunk layer for 
  86. 16-bit dynamic link libraries (DLLs) that are called by 32-bit and 16-bit 
  87. applications. 
  88.  
  89.  
  90. ΓòÉΓòÉΓòÉ 1.1.4. Multiple DOS Sessions ΓòÉΓòÉΓòÉ
  91.  
  92. The 80386 processor makes it possible for OS/2 2.0 to manage more than one DOS 
  93. application at a time.  In the virtual 8086 mode of processor, each DOS 
  94. application runs in its own copy of a DOS environment.  This feature of OS/2 
  95. 2.0 is referred to as Enhanced DOS Session. 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ 1.1.5. Virtual Device Drivers (VDDs) ΓòÉΓòÉΓòÉ
  99.  
  100. The DOS environment in OS/2 2.0 provides an extendable architecture that 
  101. permits the DOS environment to be tailored.  At the heart of this extendability 
  102. is the VDD architecture.  All of the low-level DOS support, which in previous 
  103. versions of OS/2 resided in physical device drivers (PDDs), has been moved into 
  104. VDDs.  Because of the virtual 8086 mode, all interrupt processing is done in 
  105. protect mode.  Bi-modal device drivers are no longer needed. The new driver 
  106. architecture provides PDDs for basic device support and VDDs for supporting 
  107. virtual devices to the DOS environments.  Conceptually, a VDD provides the 
  108. mechanism for sharing a physical device between OS/2 protect-mode applications 
  109. and DOS applications. 
  110.  
  111.  
  112. ΓòÉΓòÉΓòÉ 1.2. The OS/2 Operating System and Presentation Manager Program ΓòÉΓòÉΓòÉ
  113.  
  114. In a multitasking environment, it is important that all applications have some 
  115. portion of the screen through which to interact with the user. One of the 
  116. principal goals of OS/2 2.0 is to provide visual access to most, if not all, 
  117. applications at the same time.  This access can be granted by giving selected 
  118. applications full use of the screen while others wait in the background, or by 
  119. letting applications share the screen.  In OS/2 2.0, the session in which the 
  120. application runs dictates whether the application receives complete control of 
  121. the screen or must share it with other applications. 
  122.  
  123. Depending on the application type, the system can start an application in a 
  124. full-screen session.  An application running in a full-screen session has 
  125. complete control of the screen.  Applications that have complete control of the 
  126. screen are called full-screen applications. 
  127.  
  128. When the operating system first starts, it creates the PM session. PM manages 
  129. this session, as well as the screen, keyboard, and mouse resources used by 
  130. applications running in this session.  Applications running in a PM session are 
  131. called PM applications. PM applications share the screen, keyboard, and mouse 
  132. resources with other PM applications. 
  133.  
  134. Each PM application is allocated a portion of the screen, called a window.  PM 
  135. applications permit multiple windows to be displayed on the screen at a time. 
  136. In this way, PM applications share the screen. 
  137.  
  138. A window is the user interface for an application.  It can contain menus, 
  139. scroll bars, and other controls through which the user communicates with the 
  140. application. 
  141.  
  142. A PM application must create its own window before producing any output or 
  143. receiving any input.  The operating system provides the application with 
  144. detailed information about what the user is doing with the window and 
  145. automatically carries out many of the tasks the user requests, such as moving 
  146. and sizing the window. 
  147.  
  148. A PM application can create and use any number of windows to display 
  149. information in a variety of ways.  PM manages the screen, controlling the 
  150. placement and display of windows, and ensuring that no two applications attempt 
  151. to access the same part of the screen at the same time.  (In such a case, PM 
  152. overlaps the window of one application with the window of the other.) 
  153.  
  154.  
  155. ΓòÉΓòÉΓòÉ 1.2.1. Queued Input ΓòÉΓòÉΓòÉ
  156.  
  157. In traditional programming environments, an application reads from the keyboard 
  158. by making an explicit call to a function (GETCHAR, for example). The function 
  159. typically waits until the user presses a key before returning the character 
  160. code to the application.  A PM application does not make explicit calls to read 
  161. from the keyboard. Instead, the operating system receives all input from the 
  162. keyboard, mouse, and timer into the system queue.  Then each input is 
  163. redirected to the application by copying it from the system queue to the 
  164. application queue.  When the application reads the input, the next input is 
  165. redirected to the application queue, and so on.  As the application reads each 
  166. input, it dispatches messages to the appropriate windows. 
  167.  
  168. In a PM application, input from the keyboard and mouse is provided 
  169. automatically to every window that is created.  The operating system provides 
  170. input in a uniform format called an input message.  The message contains 
  171. information about the input that far exceeds the information available in other 
  172. environments.  It specifies the system time, the position of the mouse, the 
  173. state of the keyboard, the scan code of the key (if a key is pressed), the 
  174. number of the mouse button (if a button is pressed), and the device that 
  175. generated the message.  For example, the keyboard message WM_CHAR corresponds 
  176. to the pressing or releasing of a specific key.  In each message, the operating 
  177. system provides a device-independent virtual-key code that identifies the key, 
  178. in addition to the device-dependent scan code generated by the keyboard.  The 
  179. message also specifies the status of other keys on the keyboard, such as SHIFT, 
  180. CTRL, and NUMLOCK.  Keyboard, mouse, and timer messages all have the same 
  181. format and are processed in the same manner. 
  182.  
  183.  
  184. ΓòÉΓòÉΓòÉ 1.2.2. Device-Independent Graphics ΓòÉΓòÉΓòÉ
  185.  
  186. In PM operations, you have access to a set of device-independent graphics 
  187. operations.  This means that your applications can easily draw simple or 
  188. complex shapes;  they can make the same calls and use the same data to draw a 
  189. high-resolution graphics display that they would use to draw on a dot-matrix 
  190. printer. 
  191.  
  192. The operating system requires presentation drivers to convert graphics-output 
  193. requests to output for a printer, plotter, display, or other output device.  A 
  194. presentation driver is an executable library that is loaded by PM and is used 
  195. to carry out graphics operations in the context of the specific device; that 
  196. is, the device driver, the output device, and the communications port. 
  197.  
  198.  
  199. ΓòÉΓòÉΓòÉ 1.2.3. Shared Resources ΓòÉΓòÉΓòÉ
  200.  
  201. OS/2 2.0, a multitasking system, requires that PM applications share the 
  202. display, the keyboard, the mouse, and even the processor, with all other 
  203. applications that currently are running in the same session or in other 
  204. sessions.  For this reason, the operating system carefully controls these 
  205. resources and requires applications to use a specific programming interface 
  206. that guarantees this control. 
  207.  
  208.  
  209. ΓòÉΓòÉΓòÉ 1.3. Control Program Fundamentals ΓòÉΓòÉΓòÉ
  210.  
  211. The control program consists of all the OS/2 functions used to create processes 
  212. and threads, access disk files and devices, allocate memory, and retrieve or 
  213. set information about the system.  In PM applications, these functions 
  214. typically are used to carry out tasks for which no corresponding window-manager 
  215. or graphics programming interface (GPI) function exists. Full-screen 
  216. applications almost exclusively use these functions, even to interact with the 
  217. user and access the devices of the computer. 
  218.  
  219.  
  220. ΓòÉΓòÉΓòÉ 1.3.1. Multitasking ΓòÉΓòÉΓòÉ
  221.  
  222. Multitasking, one of the principal features of OS/2 2.0, is the ability of the 
  223. system to manage the execution of more than one application at a time.  This 
  224. ability helps to optimize use of the computer, because time normally spent by 
  225. an application waiting for user input is distributed to other applications that 
  226. might be printing a document or recalculating a spreadsheet. 
  227.  
  228. OS/2 2.0 supports two types of multitasking.  The first type enables an 
  229. application to start other programs, in separate processes, that will execute 
  230. concurrently with the application.  These programs can be a new copy of the 
  231. application, a related program that is designed to work with the application, 
  232. or an unrelated program.  The second type of multitasking enables applications 
  233. to run multiple threads of execution within the same process; separate 
  234. activities can be multitasked within the application. 
  235.  
  236. Although all the applications appear to the user to be running simultaneously, 
  237. the processor actually can perform only one task at a time.  The processor 
  238. often must wait for input or output from a relatively slow device, such as the 
  239. keyboard or disk.  While the processor is waiting, another task can be run. 
  240.  
  241. An application often has to perform multiple tasks that can be synchronized. 
  242. To make efficient use of the processor, an application can be structured to 
  243. execute one piece of work while another is waiting for something to happen. 
  244. The application can be written so that it can be executed with other 
  245. applications of which it has no knowledge. 
  246.  
  247. The operating system manages the concurrent processing of applications by 
  248. making certain that computer resources are so allocated that one application 
  249. does not interfere with another.  However, to share the OS/2 environment, the 
  250. application must plan and synchronize execution of its routines. 
  251.  
  252. To coexist harmoniously in the multitasking environment, each application must 
  253. be able to communicate with other applications, to synchronize its activities, 
  254. and to serialize its use of resources. It must be able to start, stop, and 
  255. control its units of execution. 
  256.  
  257. The operating system helps to control the multitasking environment on three 
  258. levels: sessions, processes, and threads.  This three-tier hierarchy addresses 
  259. both the user's need to control concurrent execution and the developer's need 
  260. to design applications whose activities can be performed concurrently. 
  261.  
  262. The following figure illustrates the hierarchical relationships of the 
  263. multitasking elements. 
  264.  
  265. Multitasking Hierarchy 
  266.  
  267.  
  268. ΓòÉΓòÉΓòÉ 1.3.1.1. Sessions ΓòÉΓòÉΓòÉ
  269.  
  270. A session is the highest level of the OS/2 multitasking hierarchy.  It consists 
  271. of virtual/logical devices, such as the screen (or a window), keyboard, and 
  272. mouse, and their related processes.  Logical devices are mapped to these 
  273. physical devices when the user selects a session by bringing it to the 
  274. foreground to perform I/O.  Generally, each application runs in its own 
  275. session.  However, more than one application in the PM session can share the 
  276. physical screen, keyboard, and mouse. 
  277.  
  278. Sessions can be arranged in a parent-child hierarchy.  By default, a parent 
  279. session can make a child session available for the user to select from the 
  280. Workplace Shell.  A session can start another independent session.  In this 
  281. case, the starting session cannot control whether the user can select the 
  282. second session.  If a session is running in the foreground, it can bring any of 
  283. its child sessions to the foreground. A parent session can end its own child 
  284. sessions but cannot end their descendants.  However, if a child session is 
  285. ended, the operating system automatically ends the related descendant sessions. 
  286.  
  287.  
  288. ΓòÉΓòÉΓòÉ 1.3.1.2. Processes ΓòÉΓòÉΓòÉ
  289.  
  290. A process is the logical unit of resources allocated to run an application. 
  291. These resources include memory, files, pipes, queues, system semaphores, and 
  292. device monitors.  Each application that has been loaded into memory and is 
  293. running is called a process.  Each session contains at least one process. 
  294.  
  295. One process can create other processes, which are arranged in parent-child 
  296. relationships similar to sessions.  A child process created by a parent process 
  297. may inherit access to the handles to files, pipes, and devices owned by the 
  298. parent process.  The parent process retains control of its child processes and 
  299. any other processes called in the line of descendancy.  A process can control 
  300. the execution of its child processes, and can end itself and its child 
  301. processes. 
  302.  
  303. A process can give control to a set of routines that are to be executed when 
  304. the process ends.  The routines, called exit lists, free allocated resources 
  305. and perform "general housekeeping" after a normal or abnormal end. 
  306.  
  307.  
  308. ΓòÉΓòÉΓòÉ 1.3.1.3. Threads ΓòÉΓòÉΓòÉ
  309.  
  310. The smallest unit of operation to be performed within a process is called a 
  311. thread. A thread consists of instructions, related CPU register values, and a 
  312. stack.  A process always has at least one thread, called the main thread or 
  313. thread 1, and can create more threads.  These additional threads are useful for 
  314. carrying out tasks unrelated to the processing of the main thread.  For 
  315. example, a process might create a thread to write data to a disk file.  This 
  316. frees the main thread so that it can continue to process user input.  A thread 
  317. does not own system resources but shares the resources owned by the process 
  318. that created it.  An application runs when the operating system gives control 
  319. to a thread in the process.  Threads are not organized hierarchically.  Each 
  320. thread within a process is a peer with the other threads within the process. 
  321.  
  322. Using the API functions, a thread can start other threads within a process.  A 
  323. thread also can temporarily suspend and resume execution of other threads. 
  324. This can enable the thread to access a time-critical resource.  Although all 
  325. threads in a process are considered to be peers, if the first thread in a 
  326. process ends, all other threads it created also end.  It is necessary to have a 
  327. thread issue an API function to end itself when it completes its execution. 
  328.  
  329.  
  330. ΓòÉΓòÉΓòÉ 1.3.1.3.1. Dispatching Priority ΓòÉΓòÉΓòÉ
  331.  
  332. The operating system assigns each thread a dispatching priority, unless one is 
  333. explicitly defined by the API function. Processor time is allocated to only one 
  334. thread at a time.  The operating system uses time slicing  to ensure that 
  335. threads of equal priority are given equal chances for execution.  The operating 
  336. system can preempt a thread when its time slice expires or if a thread with a 
  337. higher or equal priority is ready for execution.  The default minimum time 
  338. slice is 32 milliseconds.  OS/2 timer services, accessed through the API, 
  339. support all timer-related activities, including synchronizing the activities of 
  340. threads. 
  341.  
  342. When a thread is created, its priority class, and priority level within the 
  343. class, are the same as that of the thread that created it.  The API gives the 
  344. application the ability to query or change a thread's priority class and level. 
  345. The priority classes are time-critical, fixed-high, regular, and idle-time. For 
  346. each of these classes, there are 32 priority levels: 0 to 31. A thread with 
  347. priority level 31 always receives a time slice before a thread with priority 
  348. level 30, and so on.  Threads are dispatched as follows: 
  349.  
  350. Priority class      When the thread is dispatched 
  351.  
  352. Time critical       Immediately and continuously from within the priority 
  353.                     level. (These threads handle communications or real-time 
  354.                     applications.) 
  355.  
  356. Fixed high          When no time-critical threads are waiting. 
  357.  
  358. Regular             Based on display status (background or foreground), recent 
  359.                     I/O activity, and processor use.  Most threads are 
  360.                     classified with regular priority. 
  361.  
  362. Idle-time           When no regular, fixed-high, or time-critical threads are 
  363.                     waiting. 
  364.  
  365. Although an application can set the priority level of a thread at any time, 
  366. only applications that use more than one thread or process should do so.  The 
  367. best use of priority is to speed up threads on which other threads depend.  For 
  368. example, an application might temporarily raise the priority of a thread 
  369. loading a file if another thread is waiting for that file to be loaded. Because 
  370. the priority of a thread is relative to all other threads in the system, 
  371. raising the priority of the threads in an application merely to get the extra 
  372. CPU time adversely affects the overall operation of the system. 
  373.  
  374.  
  375. ΓòÉΓòÉΓòÉ 1.3.2. Dynamic Linking ΓòÉΓòÉΓòÉ
  376.  
  377. Dynamic linking enables an application to gain access at run time to functions 
  378. that are not part of its executable code.  These functions are contained in 
  379. dynamic link libraries (DLLs)-modules that contain executable code but cannot 
  380. be run as applications.  Instead, applications load the appropriate DLLs and 
  381. execute the code in the libraries by linking to them dynamically. 
  382.  
  383. DLLs are very common in OS/2 2.0.  In fact, most of the operating system is 
  384. contained in them.  The chief advantage of DLLs is that they reduce the amount 
  385. of memory needed by an application.  An application loads a DLL only if it 
  386. needs to execute a function in the DLL.  Once the DLL is loaded, the system 
  387. also shares it with any other applications that need it.  This means that only 
  388. one copy of the DLL is loaded at any one time. 
  389.  
  390.  
  391. ΓòÉΓòÉΓòÉ 1.3.3. Memory Management ΓòÉΓòÉΓòÉ
  392.  
  393. All 32-bit applications can, at any time, allocate additional memory for their 
  394. own use.  In Version 1.X of the operating system, applications request memory 
  395. by segments.  A segment is a unit of virtual and physical memory allocation 
  396. based on the Intel 286 processor architecture.  In OS/2 2.0, applications 
  397. request memory by object.  An object is the unit of memory allocation in a 
  398. 32-bit, flat architecture. 
  399.  
  400. An memory object is allocated in units of 4KB.  One 4KB unit is called a page. 
  401. Each page within a memory object can be in one of two states, either 
  402. uncommitted (that is, the linear address range has been reserved, but is not 
  403. yet backed by physical storage) or committed (physical storage as been allotted 
  404. for the logical address range). 
  405.  
  406. In OS/2 2.0, code and data required for relatively immediate processor 
  407. execution is kept in physical memory.  Code and data which is not required for 
  408. immediate processor execution is kept on external storage devices (swap space). 
  409.  
  410. Functions that allocate memory return 32-bit pointers to memory objects ranging 
  411. in size from 1 page (page=4KB) to any size supported by available swap space. 
  412. All pointer references are 32-bit near pointers.  No segment register loads are 
  413. involved; thus all of the segment registers are equal: CS=DS=SS=ES.  Virtual 
  414. memory works by demand paging, rather than by compaction and segment swapping. 
  415. This has important implications for sizing memory objects in order to gain 
  416. optimum system performance.  All memory allocations, whether private or shared, 
  417. are guaranteed to fill committed pages with zeros.  Application developers can 
  418. rely on this fact when determining the initial contents of memory. 
  419.  
  420. OS/2 2.0 protects memory from unauthorized use.  The process that allocates 
  421. memory owns that memory, and no other process can access it. Attempting to 
  422. access memory owned by another process causes a protection violation and 
  423. usually ends the process. 
  424.  
  425. If two processes need to share memory, one can create a shared memory object 
  426. and either pass the pointer to the process that is to share the memory, or pass 
  427. the name of the shared memory to that process.  The sharing processes must 
  428. manage the shared memory. 
  429.  
  430.  
  431. ΓòÉΓòÉΓòÉ 1.3.4. The File System ΓòÉΓòÉΓòÉ
  432.  
  433. The OS/2 file system enables an application to organize and maintain data on 
  434. external devices, and provides a logical view of the storage media.  This 
  435. enables applications to manipulate data without having to be familiar with the 
  436. characteristics of each device. 
  437.  
  438. The operating system has two file systems: the file allocation table (FAT) file 
  439. system and the High Performance File System (HPFS).  The FAT file system is the 
  440. default file system for the operating system, and does not need to be 
  441. installed.  HPFS can be installed during system initialization.  HPFS manages 
  442. large disk media in a fast and consistent manner and supports files with the 
  443. long file-name format. 
  444.  
  445. The file system is arranged in a hierarchy on the physical disk. This disk can 
  446. be subdivided into two or more logical disks, or partitions, each with its own 
  447. hierarchy. 
  448.  
  449. The basic element in the file system is the file itself. A file represents a 
  450. serial stream of characters. A hierarchical collection of files is called a 
  451. directory.  A directory hierarchy contains at least one root directory at the 
  452. top of the hierarchy on each logical disk.  Directories also can contain other 
  453. directories, called sub-directories, which are collections of files at a lower 
  454. hierarchical level. Using directories and sub-directories, an application can 
  455. organize the contents of a disk into logical groups of files. 
  456.  
  457. The operating system provides API functions to enable the application to 
  458. create, open, read, write, and close files, and to create and delete 
  459. sub-directories.  Once a file is opened, it is assigned an identifier called a 
  460. file handle, which can be used by related processes to refer to the file. 
  461.  
  462. OS/2 2.0 also supports extended attributes, which enable an application to 
  463. attach various information to a file object.  Extended attributes consist of an 
  464. ASCII text name and an arbitrary value.  For information about naming extended 
  465. attributes and defining data types, see the OS/2 Programming Guide, Volume I. 
  466.  
  467. Because any application in the multitasking environment can issue API 
  468. functions, it is possible that two applications can request access to the same 
  469. file at the same time.  To prevent such conflicts, the operating system 
  470. provides facilities that, upon request, control access to the information 
  471. stored in files.  The process that opens a file can define how other processes 
  472. must share the file.  If the file is large and needs to be used frequently, a 
  473. procedure called file locking permits a process to protect only small portions 
  474. of the file, leaving the rest of the file available. 
  475.  
  476. OS/2 2.0 manages its disk files and devices in essentially the same way.  For 
  477. example, an application can use the same functions to open and read from a disk 
  478. file as it uses to open and read from a serial port.  Each open file or device 
  479. is identified by a unique file handle.  The application uses the handle in 
  480. system functions to access the file or device. 
  481.  
  482. A standard device represents a stream of characters, much like a file does.  In 
  483. most cases, devices look like files to the application.  Like files, devices 
  484. are identified with ASCII names.  The OS/2 Programming Guide, Volume I 
  485. describes specific naming conventions. 
  486.  
  487. The operating system provides file subsystem API functions that enable the 
  488. application to create, open, read, write, and close devices. I/O performed on 
  489. character devices (devices that handle data one character at a time) must be 
  490. processed serially.  When a device is opened, it is assigned an identifier 
  491. called a device handle.  The device handle can be used by a process for input 
  492. and output, and for other read and write operations to and from the device. 
  493.  
  494. When a process opens a file, it specifies whether the file can be shared-that 
  495. is, whether it can be accessed and possibly modified by other processes.  This 
  496. sharing also applies to devices that a process might open.  Processes can open 
  497. any device directly, including the parallel port and the serial ports. OS/2 2.0 
  498. provides a wide range of I/O control functions that a process can use to access 
  499. and set the modes of the devices it has opened. 
  500.  
  501. Each process started in the OS/2 environment is provided with a standard set of 
  502. device handles.  These identify the system's standard input device (usually the 
  503. keyboard), the system's standard output device (usually the screen), and the 
  504. standard error device (usually the screen) to which error information is 
  505. written. 
  506.  
  507. Ordinarily, the system automatically opens three file handles when an 
  508. application starts: the standard-input, standard-output, and standard-error 
  509. files.  These files handles correspond to the keyboard and full-screen display. 
  510. The application can use these file handles to read from the keyboard and write 
  511. to a full-screen display. 
  512.  
  513. An application cannot distinguish between file handles, device handles, and 
  514. pipe handles.  The advantage of using the standard device handles is that data 
  515. stored in files can be redirected to devices without intervention by the 
  516. application.  This also means that one application can redirect its output data 
  517. stream to another application's input data stream by using a pipe. 
  518.  
  519.  
  520. ΓòÉΓòÉΓòÉ 1.3.5. Inter-process Communication ΓòÉΓòÉΓòÉ
  521.  
  522. In a multitasking environment, processes and threads need to communicate with 
  523. one another to synchronize events and to control access to shared resources. 
  524. The operating system provides a set of inter-process communication (IPC) 
  525. protocols for such purposes.  These protocols are semaphores, pipes, queues, 
  526. shared memory, exception handling, multiple DOS sessions, and device support. 
  527.  
  528.  
  529. ΓòÉΓòÉΓòÉ 1.3.5.1. Semaphores ΓòÉΓòÉΓòÉ
  530.  
  531. A semaphore is used by a process to signal the beginning and end of a given 
  532. operation, and to prevent more than one thread within the process from 
  533. accessing a specific resource at the same time.  A process can create and use 
  534. three types of semaphores:  mutual exclusion (mutex), event, and multiple wait 
  535. (muxwait). 
  536.  
  537. A mutex semaphore is used by several threads within a process, or by several 
  538. processes, to protect access to critical regions.  For example, a mutex 
  539. semaphore can be used to prevent more than one thread at a time from updating a 
  540. file on disk. 
  541.  
  542. An event semaphore provides a means for signaling among threads or among 
  543. several processes.  A typical use would be managing shared memory.  For 
  544. example, process 1 writes into the shared region, then uses an event semaphore 
  545. to signal processes 2 and 3 so that they can proceed to access the shared data. 
  546.  
  547. A muxwait semaphore enables a thread to wait on several event or mutex 
  548. semaphores simultaneously.  It is a compound semaphore that consists of up to 
  549. 64 event semaphores or mutex semaphores (the two types cannot be mixed).  A 
  550. typical use would be when a thread requires access to several shared regions of 
  551. memory at once.  The system blocks the thread until the thread acquires 
  552. ownership of all mutex semaphores protecting the shared regions.  The thread 
  553. can then access the regions. 
  554.  
  555.  
  556. ΓòÉΓòÉΓòÉ 1.3.5.2. Pipes ΓòÉΓòÉΓòÉ
  557.  
  558. Pipes enable two processes to communicate.  They are identified by handles and 
  559. can be accessed like files.  To communicate, processes open a pipe, then one 
  560. retrieves the pipe's read handle, and the other retrieves its write handle. 
  561. The processes then communicate by writing to and reading from the pipe using 
  562. the handles.  Typically, a pipe is used to direct the output from one process 
  563. to the standard input of another process. 
  564.  
  565. In OS/2 2.0, there are two types of pipes- named and unnamed.  An unnamed pipe 
  566. is used only for communications between related (parent and child) processes. 
  567. A named pipe can be used to communicate between unrelated processes running on 
  568. the same or different computers.  Any process that knows the name of the pipe 
  569. can open and use a named pipe.  One process (the server process) creates and 
  570. connects the pipe, and another process (the client process) opens the pipe. 
  571. Once the pipe is connected and opened, the server and client processes can pass 
  572. data back and forth. 
  573.  
  574. The client process can be local (on the same computer as the server process) or 
  575. remote (client process connects to a server process across a local area 
  576. network, or LAN). 
  577.  
  578.  
  579. ΓòÉΓòÉΓòÉ 1.3.5.3. Queues ΓòÉΓòÉΓòÉ
  580.  
  581. A queue is an ordered list of data that a process can use to receive 
  582. information from other processes.  Processes pass information to a queue in the 
  583. form of elements. The process that owns the queue can then read the elements 
  584. from the queue.  (PM applications also have queues, called message queues. 
  585. Message queues and the queues described here are not the same.) 
  586.  
  587. Elements in a queue can be accessed individually.  They can be accessed in 
  588. first in, first out (FIFO) or last in, first out (LIFO) sequence.  The 
  589. application also can define the priority of a queue element.  Although multiple 
  590. processes can write to a queue, only the process that created the queue can 
  591. read it.  Individual elements in a queue can be examined without being removed 
  592. from the queue. 
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ 1.3.5.4. Shared Memory ΓòÉΓòÉΓòÉ
  596.  
  597. OS/2 2.0 enables two processes, or all processes, in the system to share a 
  598. single memory object.  Applications must explicitly request access to shared 
  599. memory; the shared memory is protected from applications that are not granted 
  600. access. 
  601.  
  602. For two processes to share memory, one process allocates a memory object and 
  603. designates that it is to be shared.  The process then issues a function to 
  604. notify the system that a second process can share the memory.  The operating 
  605. system returns the linear address, which is a a unique value that identifies 
  606. the memory object.  The first process then passes the linear address to the 
  607. second process by way of some type of IPC, such as a queue. 
  608.  
  609. If all processes in the system need to share a memory object, the allocating 
  610. process gives the object a name.  This name then is passed to other processes 
  611. using IPC, such as a queue or a pipe.  The other processes then request access 
  612. to the object by name, and the operating system returns the selector to the 
  613. memory object.  This technique is called named shared memory. 
  614.  
  615.  
  616. ΓòÉΓòÉΓòÉ 1.3.5.5. Exception Handling ΓòÉΓòÉΓòÉ
  617.  
  618. With OS/2 2.0, an application can deal internally with unexpected errors (such 
  619. as memory protection violations and termination signals from other processes) 
  620. without having to terminate. 
  621.  
  622. A multitasking operating system such as OS/2 2.0 must manage applications 
  623. carefully.  A serious error (such as an attempt to access protected memory) 
  624. occurring in one application cannot be allowed to damage any other application 
  625. in the system.  To deal with errors that might damage other applications, OS/2 
  626. 2.0 defines a class of error conditions called exceptions, and defines default 
  627. actions for those errors. 
  628.  
  629. When an exception occurs, the operating system usually ends the application 
  630. causing the exception, unless the application has registered its own 
  631. exception-handling routine.  An application can use these routines to attempt a 
  632. recovery from unexpected events.  The application might be able to correct the 
  633. exception and continue. 
  634.  
  635.  
  636. ΓòÉΓòÉΓòÉ 1.3.5.6. Multiple DOS Sessions ΓòÉΓòÉΓòÉ
  637.  
  638. OS/2 2.0 provides DOS compatibility through the virtual 8086 mode of the 80386 
  639. microprocessor, and it provides more than one DOS compatibility environment. 
  640. The DOS environment offered with OS/2 2.0 is more DOS-compatible than the one 
  641. offered with previous versions, because it encapsulates the entire DOS 
  642. environment in a virtual machine.  OS/2 also enables the execution of multiple 
  643. concurrent DOS sessions. This method of implementation provides preemptive 
  644. multitasking for DOS sessions, and allows normal OS/2 levels of memory 
  645. protection; that is, provides isolation of system memory and memory belonging 
  646. to other applications, protection from illegal memory accesses by unpredictable 
  647. applications, and the ability to terminate sessions where applications are 
  648. "hung." 
  649.  
  650. A DOS application can be run in a full-screen, as a window, or as an icon in 
  651. the background.  In addition to better protection, better compatibility, and 
  652. more DOS sessions, the DOS environment of OS/2 2.0 gives applications more than 
  653. 600KB in which to execute. 
  654.  
  655.  
  656. ΓòÉΓòÉΓòÉ 1.3.5.7. Device Support ΓòÉΓòÉΓòÉ
  657.  
  658. Device drivers are the software interface between applications and the 
  659. operating system, and the hardware.  Device drivers enable the applications and 
  660. operating system to be somewhat device independent.  If the device-driver layer 
  661. did not exist, the operating system would have to be rewritten every time a new 
  662. device is added. 
  663.  
  664. There are two types of devices-character and block.  A character device handles 
  665. streams of data, and performs in a serial manner.  A block device normally 
  666. holds large amounts of data that can be accessed either serially or randomly. 
  667. Block devices include disks and virtual disks.  From the application's 
  668. viewpoint, transfers of blocks of data are transparent.  The application 
  669. performs I/O using the file-system API functions. 
  670.  
  671. In the multitasking environment, multiple applications share resources, 
  672. including devices.  A device driver manages the device to ensure that the 
  673. applications have access to it.  The application uses an API function to 
  674. communicate with the operating system.  The operating system uses an I/O 
  675. control (IOCtl) interface to communicate with the device driver. 
  676.  
  677. The device driver often needs access to system services, such as memory or 
  678. inter-process communication mechanisms. These services are provided by 
  679. device-helper (DevHlp) routines. Some of the services are: 
  680.  
  681. o Managing the device queue 
  682. o Synchronizing threads 
  683. o Managing memory 
  684. o Managing processes 
  685. o Managing interrupts 
  686. o Handling the timer 
  687. o Monitoring data buffers. 
  688.  
  689. The architecture of the device driver model for OS/2 2.0 separates DOS support 
  690. from the basic OS/2 device support by providing two types of device drivers: 
  691. physical and virtual.  Most 16-bit OS/2 device drivers work "as is," unless 
  692. they provide support for the DOS environment using the DevHelp function, 
  693. SetROMVector.  In these cases, the driver still works, but not for the DOS 
  694. environment.  The code written as bi-modal code in these drivers still works in 
  695. OS/2 2.0, but only the protect-mode code will be called. 
  696.  
  697. The basic device driver-model for OS/2 2.0 has also been enhanced to support 
  698. devices in a paged environment.  Most devices that use direct memory access 
  699. (DMA) cannot handle blocks of memory that are not adjoining, which occurs as 
  700. soon as paging is enabled.  Therefore, a device driver should be written 
  701. according to the device's ability to deal with a paged environment. 
  702.  
  703.  
  704. ΓòÉΓòÉΓòÉ 1.4. PM Fundamentals ΓòÉΓòÉΓòÉ
  705.  
  706. PM provides a message-based, event-driven, graphical user interface for the 
  707. OS/2 environment.  Some of the major features of PM are: 
  708.  
  709. o The window environment 
  710. o The user interface 
  711. o Input management 
  712. o Application resource management 
  713. o Data exchange 
  714. o The Information Presentation Facility 
  715. o Presentation drivers 
  716. PM enables programmers to build applications that conform to Systems 
  717. Application Architecture* (SAA*) guidelines. For more information on SAA 
  718. requirements, see the Systems Application Architecture:  Common User Access 
  719. Guide to User Interface Design and Systems Application Architecture:  Common 
  720. User Access Advanced Interface Design Reference. 
  721.  
  722.  
  723. ΓòÉΓòÉΓòÉ 1.4.1. The Window Environment ΓòÉΓòÉΓòÉ
  724.  
  725. The PM user interface is based on windows, an area of the screen through which 
  726. interaction is presented to the user.  A large number of API functions (which 
  727. begin with the prefix Win) are available for controlling windows.  These 
  728. functions enable an application to create, size, move, and control windows and 
  729. their contents.  The OS/2 Programming Guide, Volume II describes common 
  730. programming techniques for managing the window environment. 
  731.  
  732.  
  733. ΓòÉΓòÉΓòÉ 1.4.1.1. Defining Window Relationships ΓòÉΓòÉΓòÉ
  734.  
  735. A window is an area of the screen where an application displays output and 
  736. receives input from the user.  A screen can have more than one window.  The 
  737. common analogy is that multiple windows on the screen are like many pieces of 
  738. paper on a Desktop. In the analogy, the Desktop is the area that comprises the 
  739. background of the screen.  Windows, like papers, can be arranged to lie on top 
  740. of one another and to overlap.  If they overlap, the bottom papers can be 
  741. either partially or completely hidden.  Windows can be defined in the window 
  742. hierarchy using the API. 
  743.  
  744. The following figure illustrates the window hierarchy as it appears on the 
  745. screen. 
  746.  
  747.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  748.  Γöé    Desktop Window                              Γöé
  749.  Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                Γöé
  750.  Γöé  Γöé Main Window 3              Γöé                Γöé
  751.  Γöé  Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé
  752.  Γöé  Γöé      Γöé Main Window 2              Γöé         Γöé
  753.  Γöé  Γöé      Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé
  754.  Γöé  Γöé      Γöé  ΓöîΓöÇΓöÇΓöÇΓöñ Main Window 1              Γöé  Γöé
  755.  Γöé  Γöé      Γöé  ΓöéChiΓöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé  Γöé
  756.  Γöé  Γöé      Γöé  ΓöéWinΓöé  Γöé               Γöé         Γöé  Γöé
  757.  Γöé  Γöé      Γöé  Γöé2A Γöé  Γöé               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé  Γöé
  758.  Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  ΓööΓöÇΓöÇΓöÇΓöñ  ΓöéChild Window 1aΓöé      Γöé  Γöé  Γöé
  759.  Γöé         Γöé      Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ      Γöé  Γöé  Γöé
  760.  Γöé         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ       Γöé Child Window 1b Γöé  Γöé  Γöé
  761.  Γöé                Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé  Γöé
  762.  Γöé                ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé
  763.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  764.  
  765. Windows on the Screen 
  766.  
  767. The Desktop window is at the top of the hierarchy.  Below the Desktop window 
  768. are the top-level windows, called main windows.  Main windows can overlap one 
  769. another and, at times, a main window can be completely hidden.  Operations on 
  770. one main window do not affect those on other main windows. 
  771.  
  772. The following figure illustrates the hierarchical arrangement of windows 
  773. created by the application. 
  774.  
  775.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  776.   Γöé Desktop Γöé
  777.   ΓööΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÿ
  778.      Γöé Γöé Γöé     Parent            Child
  779.      Γöé Γöé Γöé                  ΓöîΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ
  780.      Γöé Γöé Γöé                       Siblings
  781.      Γöé Γöé Γöé   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé
  782.      Γöé Γöé ΓööΓöÇΓöÇΓöé Main 1 Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé Child 1A Γöé
  783.      Γöé Γöé     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÉ  Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé
  784.      Γöé Γöé                 Γöé  Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  785.      Γöé Γöé                 ΓööΓöÇΓöÇΓöÇΓöÇΓöé Child 1A Γöé Γöé
  786.      Γöé Γöé                    Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  787.      Γöé Γöé                    ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÿ
  788.      Γöé Γöé     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  789.      Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöé Main 2 Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé Child 2A Γöé
  790.      Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  791.      Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  792.      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé Main 3 Γöé
  793.              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  794.  
  795. Window Hierarchy 
  796.  
  797. Main windows can create subordinate windows in a parent-child order of 
  798. descendancy.  A child window is always clipped to its parent window, meaning 
  799. that only the part of a child window that lies within the parent window is 
  800. visible. 
  801.  
  802. Windows that share the same parent are called sibling windows. Like main 
  803. windows, sibling windows can overlap one another.  Every sibling window has a z 
  804. order position that specifies where it lies in the stack of overlapping 
  805. windows. 
  806.  
  807. The application can define another relationship in addition to the hierarchical 
  808. one.  When a window is created, an owner window can be defined.  The two 
  809. windows must be created by the same thread. The owner relationship varies at 
  810. different levels of the hierarchy.  A child window can send messages to its 
  811. owner window. If one main window owns other main windows, and the owner window 
  812. is hidden, minimized, or closed, all the owned main windows also are hidden, 
  813. minimized, or closed. 
  814.  
  815. A window can be visible, hidden, or partly hidden on the screen. When a window 
  816. is hidden or partly hidden, its size, position, and hierarchical and owner 
  817. relationships remain the same.  However, when the window becomes visible again, 
  818. any area of the window that was previously hidden is redrawn.  A window can 
  819. also be disabled, meaning that it is still visible but unable to respond to 
  820. mouse input. 
  821.  
  822.  
  823. ΓòÉΓòÉΓòÉ 1.4.1.2. Creating and Classifying Windows ΓòÉΓòÉΓòÉ
  824.  
  825. A window and its associated window procedure are considered to be a program 
  826. object.  A  window procedure "represents" a window in the sense that the window 
  827. procedure controls all aspects of the window, such as what it looks like, how 
  828. it responds to changes, and how it processes input. See Processing Messages for 
  829. more information about the window procedure. 
  830.  
  831. A window class is a set of windows that has the same window procedure to 
  832. implement them.  Many windows can belong to a window class.  The windows can 
  833. differ from one another only in the data they process.  If multiple 
  834. applications have need for the same type of window, implementing common window 
  835. classes is an efficient way of using system resources. 
  836.  
  837. OS/2 2.0 provides many preregistered window classes. The windows specified in 
  838. these classes are designed specifically to meet the needs for a graphics-based 
  839. standard user interface. These window classes include those that implement such 
  840. windows as the one described in Standard and Control Windows. If a 
  841. preregistered window class is not provided, the application must register the 
  842. class at the process level.  Several API functions are available for 
  843. applications to reserve a small area of memory (the window words area) for 
  844. windows in classes registered by the application. If a window is expected to 
  845. handle large amounts of data, the data should be held in memory and referred 
  846. from the window words area. 
  847.  
  848. A window class can be defined as private or public. Windows created in either 
  849. class can be used by any process in the system. "Public" and "private" refer 
  850. only to the window class at the time the window is created. 
  851.  
  852. Only the process with which a private class is registered can create a window 
  853. for that class.  The class name must be unique to the process. However, other 
  854. processes can register private classes with the same class name. 
  855.  
  856. Any process can create a window in a public class.  Window procedures for 
  857. windows in public classes must be available to all processes.  Thus, such 
  858. classes should be defined in DLLs.  Public-class names must be unique for each 
  859. process. 
  860.  
  861. All windows have certain attributes. Each window is identified by a window 
  862. handle. Each window represents a rectangle describing the size and position of 
  863. the window on the screen.  The size of a window is defined in picture elements 
  864. (pels) relative to the origin of the parent window.  The origin of a window, 
  865. the lower-left corner, is the 0,0 coordinate in a set of x and y axes.  The x 
  866. and y coordinates define the top, bottom, and sides of the window.  The 
  867. coordinates range from -32768 to +32767 pels in each direction, so the maximum 
  868. size that can be specified in any direction is 65535 pels. 
  869.  
  870. The application also can position a window by defining its relative distance 
  871. from the point of origin (0,0) of its parent window.  If the application 
  872. positions a child window outside its parent window, which is permissible, only 
  873. the part of the child window within the parent window will be visible on the 
  874. screen. 
  875.  
  876. Using a set of API functions, the application can modify the behavior of a 
  877. window in a window class, or create a new class from an existing one.  This 
  878. process, sub-classing, enables the application to modify the behavior of a 
  879. single window without rewriting its complete window procedure. 
  880.  
  881.  
  882. ΓòÉΓòÉΓòÉ 1.4.2. Providing the User Interface ΓòÉΓòÉΓòÉ
  883.  
  884. The Common User Access* (CUA*) is a set of guidelines for designing and writing 
  885. the application's user interface.  The guidelines cover standard menu-bar 
  886. items, interaction techniques, and window types.  Use the CUA guidelines in 
  887. deciding how to design the user interface for your application's user 
  888. interface. 
  889.  
  890. Many PM services, if allowed to default, help to enable a consistent user 
  891. interface among applications designed and written according to the CUA 
  892. guidelines.  Consistency also is enabled by the selection of appropriate 
  893. options.  Ensuring consistency is the responsibility of the application 
  894. developer. 
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ 1.4.2.1. Standard and Control Windows ΓòÉΓòÉΓòÉ
  898.  
  899. Information is displayed on the screen through the use of windows. PM supports 
  900. a standard window, whose elements generally conform to CUA guidelines. 
  901.  
  902. The standard window, which the application controls using the API functions, 
  903. can have all or some of the following elements: 
  904.  
  905. o Title-bar icon 
  906. o Window borders 
  907. o Window sizing buttons 
  908. o Menu bar 
  909. o Scroll bars 
  910. o Window title 
  911. o Information area 
  912.  
  913. The following figure illustrates a standard window and its elements. 
  914.  
  915. Standard Window 
  916.  
  917. The title-bar icon, window border, and window sizing buttons enable a user to 
  918. change the size and position of a window.  The menu bar and scroll bars enable 
  919. a user to work with the window's contents.  The window title indicates the name 
  920. of the object seen in the window, and it also indicates which kind of view is 
  921. displayed.  A view is a way of looking at an object's information. Different 
  922. views display information in different forms, which mimics the way information 
  923. is presented in the real world.  The information area displays brief messages 
  924. to a user about the object or choice that the cursor is on.  Information about 
  925. the normal completion of a process can also appear in the information area. For 
  926. example, if a user copies several objects from one container to another, the 
  927. information area in a container's window could display a brief message to tell 
  928. the user when the copying has been completed. 
  929.  
  930. The standard window is created using a standard frame window. The elements of 
  931. the standard window, such as the title bar and the menu bar, are child windows 
  932. of the standard frame window. The child windows are called control windows. The 
  933. system maintains a set of preregistered control windows that any application 
  934. can use to perform I/O. 
  935.  
  936. From the application's perspective, control windows are no different from other 
  937. windows in the system, and the application can manage them using 
  938. window-management functions.  Each control window has its own window identifier 
  939. and a specific set of messages.  The application can query the system to 
  940. determine the control window's parent. 
  941.  
  942. Control windows can be used as a part of a dialog window. A dialog window can 
  943. be created using a dialog template, which defines the position, appearance, and 
  944. identifier of the dialog window and each of its child windows.  A template can 
  945. be loaded as a resource or created dynamically in memory.  It can be used to 
  946. create dialog windows of all window classes.  The window classes can contain 
  947. control windows of all window classes.  Also, the application can create its 
  948. own dialog controls by creating and preregistering its own control-window 
  949. class. 
  950.  
  951. A dialog window is controlled by a window procedure called a dialog procedure. 
  952. The dialog procedure is responsible for responding to all messages sent to the 
  953. dialog window, either by sending them to the control windows or returning them 
  954. to the default dialog procedure.  A set of API functions enables the 
  955. application to create, load, process, and cancel dialog windows.  The dialog 
  956. procedure can obtain the handle of its child windows, send messages to them, 
  957. and process messages and text strings itself. 
  958.  
  959. The standard frame window and the control windows are implemented with standard 
  960. preregistered window classes.  The standard frame window manages the control 
  961. windows and the client window as the user interacts with them.  The frame 
  962. window also is responsible for routing messages to the appropriate control and 
  963. client windows. 
  964.  
  965.  
  966. ΓòÉΓòÉΓòÉ 1.4.2.2. Primary and Secondary Windows ΓòÉΓòÉΓòÉ
  967.  
  968. CUA guidelines define two types of windows:  primary and secondary.  In a PM 
  969. program, a primary window is a standard window, while a secondary window is a 
  970. control window or the child of the main window. 
  971.  
  972. A primary window is the main interface point between an object and the user. 
  973. It appears when a user opens an object, and is used to present a view of an 
  974. object or group of objects when the information displayed about the object or 
  975. group of objects is not dependent on other objects. 
  976.  
  977. Object information is presented in the area of the window below the menu bar. 
  978. A user can control the size and position of primary windows on the screen. 
  979.  
  980. A secondary window looks very much like a primary window.  For example, both 
  981. have window borders and title bars.  The important distinction between a 
  982. primary window and a secondary window is based on how they are used.  A 
  983. secondary window is always associated with a primary window and contains 
  984. information that is dependent on an object in the primary window.  A secondary 
  985. window is used, for example, to allow a user to further clarify action 
  986. requests.  A secondary window is always removed when the primary window is 
  987. closed or minimized and re-displayed when the primary window is opened or 
  988. restored. 
  989.  
  990.  
  991. ΓòÉΓòÉΓòÉ 1.4.2.3. Dialog Box ΓòÉΓòÉΓòÉ
  992.  
  993. A dialog box extends a dialog between a user and a primary or secondary window. 
  994. It usually appears when the user selects a choice from the menu bar, generating 
  995. a pull-down menu.  Selecting one of the choices in the pull-down menu generates 
  996. the dialog box.  The dialog box can contain buttons, entry fields, icons and 
  997. text, list boxes, and title bars.  A dialog box and its supporting window 
  998. enable the application to gather input from the user.  A temporary dialog 
  999. window usually is created for special-purpose input, then canceled. 
  1000.  
  1001. There are two types of dialog boxes, modal and modeless. A modal dialog box 
  1002. retains control until the application issues a call to cancel it.  Users cannot 
  1003. activate other windows belonging to the application until they finish 
  1004. interacting with the modal dialog box.  A modeless dialog box enables windows 
  1005. in other applications to be activated after it has been created. 
  1006.  
  1007.  
  1008. ΓòÉΓòÉΓòÉ 1.4.3. Handling Mouse and Keyboard Input ΓòÉΓòÉΓòÉ
  1009.  
  1010. The session manager in the operating system manages applications running in the 
  1011. PM environment, including their input and output operations.  However, PM 
  1012. handles PM applications, including their input and output operations. PM 
  1013. handles all input as messages, which are packets of data. 
  1014.  
  1015. PM supports user input from the keyboard and mouse pointer.  The mouse pointer 
  1016. is the symbol associated with the mouse pointing device.  Mouse input is 
  1017. provided by pressing a button, and usually is directed at the window under the 
  1018. mouse pointer.  The precise position on the screen that is activated is called 
  1019. the hot spot. The mouse pointer also can be moved across the screen, and the 
  1020. operating system provides support for that activity. The application can direct 
  1021. all mouse input to a single window called a mouse capture window. A mouse 
  1022. capture window enables the application to track all input from the mouse 
  1023. pointer no matter where the mouse pointer is moved on the screen. 
  1024.  
  1025. Keyboard input is sent when any key on the keyboard is pressed. All keyboard 
  1026. input is directed to one window at a time.  The window receiving keyboard input 
  1027. is called the active window.  A main window, or one of its child windows, is 
  1028. responsible for keeping the window receiving the input visible on the screen. 
  1029.  
  1030. The cursor is a symbol displayed within a window that indicates where 
  1031. characters entered from the keyboard will be placed. The cursor can be moved to 
  1032. any location within a window.  Its size and position are defined in coordinates 
  1033. relative to the window in which the cursor is located.  The application can 
  1034. create, display, move, and cancel the system cursor. 
  1035.  
  1036.  
  1037. ΓòÉΓòÉΓòÉ 1.4.3.1. Processing Messages ΓòÉΓòÉΓòÉ
  1038.  
  1039. The Common Programming Interface (CPI) defines an application structure that 
  1040. uses a system of queues and application window procedures for processing 
  1041. messages. The PM message system conforms to the CPI and is fundamental to the 
  1042. smooth operation of the PM environment.  A complete set of CPI reference 
  1043. manuals is provided in the SAA Library. 
  1044.  
  1045. The following figure illustrates the PM message-processing system. 
  1046.  
  1047. Message-Processing System 
  1048.  
  1049. In the PM environment, each input from the mouse or keyboard is delivered to an 
  1050. application as a message. A message cannot be processed before previous input, 
  1051. because the specific application and window for which input is intended are not 
  1052. known until all preceding input has been processed. 
  1053.  
  1054. All input is first placed in a single queue called the system queue. The system 
  1055. queue, which is shared by all applications in the system, receives messages 
  1056. generated by the user from the mouse and keyboard. The system queue can hold 
  1057. the input from approximately 60 key presses and mouse clicks.  The system queue 
  1058. can receive input from many sources, including the system itself, the timer, 
  1059. and other applications. However, only user input is processed synchronously. 
  1060.  
  1061. The system queue temporarily stores user input so that nothing is lost if the 
  1062. user enters data faster than the application can process it. Generally, input 
  1063. is processed in the order in which it appears in the queue, but the application 
  1064. can change the order by filtering the input.  Filtering is performed with API 
  1065. functions, but should be performed with discretion, because the processing of 
  1066. one input often changes the context for the next. 
  1067.  
  1068. Each thread that receives input has an application queue allocated by an API 
  1069. function.  This queue does not receive user input directly, but can receive 
  1070. other messages directly, such as messages from the system or timer.  Messages 
  1071. are removed from the application queue when the thread for which it is destined 
  1072. "gets" it.  The messages are prioritized if more than one is waiting.  If there 
  1073. are none, the thread is suspended until a message arrives. 
  1074.  
  1075. The most efficient use of the system will be achieved if you structure your 
  1076. application so that one thread remains responsive to user input while others 
  1077. continue processing work.  To be considered responsive to the user, the system 
  1078. must complete processing input within 0.5 seconds.  That is, the thread 
  1079. handling input should check for the next message in the queue within that time. 
  1080.  
  1081. A window procedure can control more than one window.  The procedure receives 
  1082. messages in the form of four input parameters.  The first parameter specifies 
  1083. the handle of the window for which the message is intended.  The second 
  1084. parameter indicates the type of message. The last two parameters contain 
  1085. message parameters.  Their interpretation depends on the particular message. 
  1086.  
  1087. The window procedure processes the message, then sends a return value to the 
  1088. sending code.  A window procedure must respond to all messages sent to it, even 
  1089. if the response is to send the message back to the system's default window 
  1090. procedure. 
  1091.  
  1092. There are many types of messages, each with a unique identifier, and 
  1093. applications can define their own message types using a range of identifier 
  1094. values. 
  1095.  
  1096.  
  1097. ΓòÉΓòÉΓòÉ 1.4.4. Handling Application Resources ΓòÉΓòÉΓòÉ
  1098.  
  1099. An application resource is held in a resource file, a file with information 
  1100. that helps to define a window. The resource file defines the names and 
  1101. attributes of the application resources that must be added to the application's 
  1102. executable file.  The resources are: 
  1103.  
  1104. Accelerator table 
  1105.           Used to define which key strokes are treated as accelerators and the 
  1106.           commands into which they are translated. An accelerator is a single 
  1107.           key stroke that invokes an application-defined function. 
  1108.  
  1109. Bit map 
  1110.           A representation in memory of the data displayed on an 
  1111.           all-points-addressable (APA) device, usually the screen. 
  1112.  
  1113. Dialog and window templates 
  1114.           The definitions of a dialog box or window containing details of its 
  1115.           position, appearance, its window identifier, and the identifiers of 
  1116.           its child windows. 
  1117.  
  1118. Dialog include 
  1119.           A definition of a dialog box in a header file. 
  1120.  
  1121. Fonts 
  1122.           A typeface definition for character sets, marker sets, and pattern 
  1123.           sets. 
  1124.  
  1125. Icon 
  1126.           A graphical representation of an object, consisting of an image, 
  1127.           image background, and a label. 
  1128.  
  1129. Menu 
  1130.           A list of choices that can be applied to an object.  A menu can 
  1131.           contain choices that are not available for selection in certain 
  1132.           contexts.  Those choices are indicated by reduced contrast. 
  1133.  
  1134. Pointer 
  1135.           The symbol displayed on the screen that can be moved by a pointing 
  1136.           device.  The pointer is defined in a bit map. 
  1137.  
  1138. String table 
  1139.           A null-terminated ASCII string.  A string table is loaded when needed 
  1140.           by the executable file. 
  1141.  
  1142. See the OS/2 Programming Guide, Volume II for guidance in creating a resource 
  1143. file. For guidance in building the resource file using the Resource Compiler 
  1144. (RC) utility in the IBM Developer's Toolkit for OS/2 2.0, see the online Tools 
  1145. Reference. The RC processes the resource text file to produce a binary file, 
  1146. then attaches it to the application's executable file so that an application 
  1147. can access its resources. 
  1148.  
  1149.  
  1150. ΓòÉΓòÉΓòÉ 1.4.4.1. Resource Editors ΓòÉΓòÉΓòÉ
  1151.  
  1152. The Dialog Box Editor in the Toolkit enables you to design dialog boxes 
  1153. interactively on the screen and save the definitions in a resource file.  The 
  1154. definition of the dialog box is included with other resource definitions in the 
  1155. application's resource file. 
  1156.  
  1157. The Font Editor in the Toolkit enables you to edit font files interactively on 
  1158. the screen, save the definitions in a font file, and include the font file 
  1159. names in the application's resource file.  The font file consists of a header 
  1160. file and a collection of character bit maps representing the individual 
  1161. letters, digits, and punctuation characters that display text on a screen. 
  1162.  
  1163. The Icon Editor in the Toolkit enables you to create customized icons, 
  1164. pointers, and bit maps interactively on the screen and save the definitions in 
  1165. a resource file.  You can work on a large-scale version of the icon or pointer 
  1166. while displaying a replica of the actual size. 
  1167.  
  1168.  
  1169. ΓòÉΓòÉΓòÉ 1.4.5. Exchanging Data Among Applications ΓòÉΓòÉΓòÉ
  1170.  
  1171. Both users and active applications request an exchange of data with other 
  1172. applications.  Data exchange requested by a user is held in an object called a 
  1173. clipboard.  Requests by an application to exchange data with other applications 
  1174. is called dynamic data exchange (DDE). 
  1175.  
  1176.  
  1177. ΓòÉΓòÉΓòÉ 1.4.5.1. User-Generated Data Exchange ΓòÉΓòÉΓòÉ
  1178.  
  1179. The user can transfer data from one application to another using the COPY, CUT, 
  1180. and PASTE commands.  The first step is to copy or cut (delete) selected data 
  1181. from the source application; the data is now in the clipboard.  Next, paste 
  1182. (insert) the clipboard data in the target application.  The same process can be 
  1183. used to move data from one window to another within a single application.  The 
  1184. CUT, COPY, and PASTE commands must be supported by an application as defined in 
  1185. CUA guidelines.  They are implemented using a set of PM API functions. 
  1186.  
  1187. The clipboard is the object that temporarily holds data. Generally, data is 
  1188. placed in the clipboard when a request to paste it is received.  Once data has 
  1189. been sent to the clipboard, it should not be changed.  Only one item of data at 
  1190. a time can be in the clipboard, but the data can be in a variety of formats, 
  1191. such as text, metafile, or bit map.  The application can either define the 
  1192. formats or use one of the preregistered standard formats.  The application also 
  1193. can register formats, as it can window classes, so they can be used by all 
  1194. applications in the system. 
  1195.  
  1196. The application should support as many formats as possible to satisfy requests 
  1197. from target applications.  For example, a spreadsheet application should 
  1198. support a spreadsheet format and as many common text formats as possible. 
  1199. Generating data in all formats supported by an application can consume a lot of 
  1200. the operating system's resources. It would not make sense, for example, for a 
  1201. word-processing application to support a spreadsheet format because that format 
  1202. is beyond the scope of the operation of a word processor. 
  1203.  
  1204. A clipboard can be owned by a thread.  If a thread opens the clipboard, it has 
  1205. exclusive access to the clipboard until the thread closes the clipboard. 
  1206.  
  1207. The clipboard is owned by the last window that requested ownership. Only the 
  1208. owning application can change the owner of the clipboard. If an owning window 
  1209. is canceled, data can remain in the clipboard. Before being canceled, the 
  1210. owning window must generate its data to satisfy subsequent paste requests. 
  1211.  
  1212.  
  1213. ΓòÉΓòÉΓòÉ 1.4.5.2. Application-Generated Data Exchange ΓòÉΓòÉΓòÉ
  1214.  
  1215. The DDE protocol enables applications to access one another's data.  Dynamic 
  1216. data exchange uses the PM message-processing system and the shared-memory 
  1217. inter-process communication protocol to pass large quantities of data among 
  1218. applications.  All API functions that manage shared memory begin with the 
  1219. prefix Dos. 
  1220.  
  1221. The data is held in a shared-memory segment that is available to designated 
  1222. applications or to all applications in the system. Data is passed in a 
  1223. mutually-agreed-upon format.  An application that receives a handle to a data 
  1224. object in memory receives a message if the data changes.  The application then 
  1225. can indicate, by way of a message, if it wants the changed data to be sent to 
  1226. it, or it can end the exchange. See Shared Memory for information about shared 
  1227. memory. 
  1228.  
  1229.  
  1230. ΓòÉΓòÉΓòÉ 1.4.5.3. Direct Manipulation ΓòÉΓòÉΓòÉ
  1231.  
  1232. Direct manipulation is a protocol that enables the user to visually drag an 
  1233. object in a window (the source object) and drop it on another object (the 
  1234. target object) in a window.  This causes an interaction, or data exchange, 
  1235. between two windows. 
  1236.  
  1237. The window containing the dragged object is referred to as the source.  The 
  1238. window containing the object that was dropped on is referred to as the target. 
  1239. The source and the target can be the same window, different windows within the 
  1240. same application, or windows belonging to different applications.  The dragged 
  1241. object can be the only visible object in the source window, or it can be one of 
  1242. many objects.  The target object can be the only visible object in the target 
  1243. window, or it can be one of many objects. 
  1244.  
  1245. A set of API functions with the prefix Drg supports requirements of source and 
  1246. target applications and are described in the Presentation Manager Programming 
  1247. Reference, Volume I. 
  1248.  
  1249.  
  1250. ΓòÉΓòÉΓòÉ 1.4.6. Information Presentation Facility ΓòÉΓòÉΓòÉ
  1251.  
  1252. The Information Presentation Facility (IPF) is a tag language and compiler that 
  1253. supports the design and development of online information. Information can be 
  1254. associated with the windows and fields of an application, and can be displayed 
  1255. as a Help facility.  Implementation of a Help facility requires two different 
  1256. development efforts: 
  1257.  
  1258. o The development of the code that communicates with IPF and PM to display help 
  1259.   panels. 
  1260.  
  1261. o The development of a library of IPF tag-language files that define the 
  1262.   contextual Help panels for the fields within the windows. 
  1263.  
  1264.  
  1265. ΓòÉΓòÉΓòÉ 1.4.6.1. Coding the Application ΓòÉΓòÉΓòÉ
  1266.  
  1267. The PM code that calls the IPF Help hook is in the PM default window procedure. 
  1268. Use WinDefWindowProc for a standard window, or WinDefDlgProc for a dialog box. 
  1269. The functions relating to the creation of the Help instance are 
  1270. WinCreateHelpInstance, WinAssociateHelpInstance, and WinDestroyHelpInstance. 
  1271.  
  1272.  
  1273. ΓòÉΓòÉΓòÉ 1.4.6.2. Developing the Help Information ΓòÉΓòÉΓòÉ
  1274.  
  1275. A Help panel is a unit of text within an application window. The database for 
  1276. the Help-panel text includes IPF tag language, which defines various 
  1277. characteristics of the text displayed in the Help text window. The IPF Compiler 
  1278. translates the tags into a format that is used by IPF.  For more information 
  1279. about IPF, see the Information Presentation Facility Guide and Reference. 
  1280.  
  1281.  
  1282. ΓòÉΓòÉΓòÉ 1.4.7. Presentation Drivers ΓòÉΓòÉΓòÉ
  1283.  
  1284. Presentation drivers are special-purpose I/O routines that handle field 
  1285. device-independent I/O requests from the PM and its applications.  The requests 
  1286. are resolved with the device-specific attributes of the device.  For detailed 
  1287. information about presentation drivers, see the Presentation Driver Reference. 
  1288.  
  1289. The presentation driver is a higher-level interface to an output device than 
  1290. the OS/2 device driver.  OS/2 device drivers are loaded at privilege level 0, 
  1291. the highest privilege level.  All 16-bit presentation drivers are loaded at 
  1292. privilege level 2, while 32-bit presentation drivers are loaded at privilege 
  1293. level 3. 
  1294.  
  1295. Presentation drivers are subsystems.  They resolve I/O requests from PM and 
  1296. applications in the PM environment by interfacing directly with the device or 
  1297. with its device driver.  Printer and plotter presentation drivers use the 
  1298. spooler interface beginning with the prefix Spl to pass data and controls to 
  1299. the OS/2 device drivers.  Screen presentation drivers pass data and controls 
  1300. directly to the display hardware interface. 
  1301.  
  1302. Presentation drivers are supplied as DLLs.  When a PM program is initialized, 
  1303. the screen presentation driver is loaded and enabled automatically.  Other 
  1304. presentation drivers, such as those supporting the printer and plotter, are 
  1305. loaded and enabled in response to the application requesting a device context. 
  1306.  
  1307.  
  1308. ΓòÉΓòÉΓòÉ 1.5. The Graphics Programming Interface ΓòÉΓòÉΓòÉ
  1309.  
  1310. The graphics programming interface (GPI) consists of the OS/2 system functions 
  1311. that let you create device-independent graphics for your applications.  The GPI 
  1312. functions are used in conjunction with the window manager to draw lines, 
  1313. shapes, and text in a window.  Applications can also use the GPI functions to 
  1314. draw graphics output on such devices as raster printers and vector plotters. 
  1315.  
  1316.  
  1317. ΓòÉΓòÉΓòÉ 1.5.1. Presentation Spaces and Device Contexts ΓòÉΓòÉΓòÉ
  1318.  
  1319. A presentation space is the key to an application's access to the system 
  1320. display, to printers, and to other graphics-output devices. Conceptually, a 
  1321. presentation space is a device-independent space in which you can create and 
  1322. manipulate graphics.  The presentation space defines your drawing environment 
  1323. by specifying the tools you have available to create graphics.  These tools 
  1324. include the graphics primitives granted to every presentation space, in 
  1325. addition to the bit maps and fonts that your application loads for its 
  1326. exclusive use. 
  1327.  
  1328. Actually, a presentation space is little more than a data structure whose 
  1329. fields contain values that define the drawing environment. The values represent 
  1330. the colors, widths, styles, and other attributes of the graphics you draw.  The 
  1331. system creates the data structure when you create the presentation space and 
  1332. initializes the structure to default values. 
  1333.  
  1334. You must create a presentation space to create graphics.  You must also create 
  1335. a device context to display those graphics on a device. A device context is a 
  1336. bridge from a presentation space to a specific device.  You create a device 
  1337. context by specifying the device you want to access and the type of access you 
  1338. want, such as direct or queued (for printing).  You begin displaying graphics 
  1339. on the device by associating the device context with the presentation space. 
  1340. Once you have associated the device context, any lines, text, and images you 
  1341. draw in the presentation space are also displayed on the associated device. 
  1342.  
  1343. Like a presentation space, a device context is a data structure. It contains 
  1344. information about the device driver that supports the specified device.  The 
  1345. device driver interprets graphics commands sent to it from the presentation 
  1346. space and creates the corresponding commands for its device.  It then sends the 
  1347. commands either directly to the device or to the spooler, depending on the type 
  1348. of access you gave the device context when you created it. 
  1349.  
  1350.  
  1351. ΓòÉΓòÉΓòÉ 1.5.2. Graphics Primitives ΓòÉΓòÉΓòÉ
  1352.  
  1353. In OS/2 2.0, graphics primitives are lines, arcs, markers, text, and areas. 
  1354. They are called primitives because you use them as the basic tools to create 
  1355. the documents, pictures, and other composite graphics that your applications 
  1356. display to the user. 
  1357.  
  1358. You draw a primitive by using a Gpi function.  For example, to draw a line, you 
  1359. use the GpiLine function and specify the ending point of the line.  The 
  1360. function uses the current point as the starting point for the line and draws 
  1361. from the starting point to the ending point.  The current point is simply the 
  1362. ending point of the last primitive, unless you explicitly set the current point 
  1363. by using a function such as GpiMove. 
  1364.  
  1365. A line primitive is a straight line.  An arc primitive is a curve.  Curves can 
  1366. be arcs of a circle or an ellipse, or they can be more complex curves, such as 
  1367. splines and fillets.  A marker primitive is a mark or character that you draw 
  1368. at a specific point.  Markers are typically used to plot points in a graph.  An 
  1369. area primitive is a closed figure that can be filled with a pattern.  A common 
  1370. use for an area primitive is to represent a cross-section in a mechanical 
  1371. drawing. 
  1372.  
  1373. Every primitive has a corresponding set of primitive attributes.  The 
  1374. attributes specify the color, style, size and orientation of the primitive when 
  1375. your application draws it.  The primitive attributes are given default values 
  1376. when you create the presentation space, so you can use the primitives 
  1377. immediately.  However, you can reset the attributes at any time.  You have the 
  1378. choice of changing the attributes for individual primitives or changing a 
  1379. specific attribute for all primitives.  For example, you can set the color for 
  1380. all primitives by using the GpiSetColor function,  or you can set it just for 
  1381. the line primitive by using the GpiSetAttrs function. 
  1382.  
  1383.  
  1384. ΓòÉΓòÉΓòÉ 1.5.3. Graphics Objects and Operations ΓòÉΓòÉΓòÉ
  1385.  
  1386. In addition to the graphics primitives, OS/2 2.0 provides graphics objects and 
  1387. operations that are used to manipulate primitives. Graphic objects are paths, 
  1388. bit maps, fonts, and logical color palettes.  Graphic operations are clippings 
  1389. and transformations. 
  1390.  
  1391.  
  1392. ΓòÉΓòÉΓòÉ 1.5.3.1. Path ΓòÉΓòÉΓòÉ
  1393.  
  1394. A path is a sequence of lines that you can use to create a filled area, a 
  1395. geometric line, or a clip path.  A path is very much like an area primitive, in 
  1396. that you can use the path as a closed figure and fill it with a pattern. 
  1397. Unlike an area primitive, however, a path can be used to create geometric 
  1398. lines, sometimes called wide lines.  Geometric lines are drawn, using a given 
  1399. width and pattern, so that they follow the outline specified by the path. The 
  1400. width of a geometric line can be transformed, unlike the width of a line 
  1401. primitive. 
  1402.  
  1403.  
  1404. ΓòÉΓòÉΓòÉ 1.5.3.2. Bit Map ΓòÉΓòÉΓòÉ
  1405.  
  1406. A bit map is an array of bits that represents an image you can display on a 
  1407. raster output device.  Bit maps typically represent scanned images and icons 
  1408. and are very much like image primitives, except a bit map can have several 
  1409. different formats, each specifying color information that an image primitive 
  1410. cannot contain.  Also, bit maps can be used to create fill patterns to fill 
  1411. figures created by using paths and area primitives.  Finally, bit maps can be 
  1412. copied from one presentation space to another or even from one location to 
  1413. another within the same presentation space. 
  1414.  
  1415.  
  1416. ΓòÉΓòÉΓòÉ 1.5.3.3. Font ΓòÉΓòÉΓòÉ
  1417.  
  1418. A font is a collection of character primitives that share a common height, line 
  1419. weight, and appearance.  The height of a font is specified in printer's points, 
  1420. a point being a typographic unit of measurement equal to 1/72 of an inch. A 
  1421. collection of fonts that share common stroke-width and serif characteristics is 
  1422. a font family.  The term "stroke-width" refers to the width of lines used to 
  1423. draw characters and symbols from a font.  A serif is a short cross-line drawn 
  1424. at the ends of the main strokes that form a character or symbol.  Some common 
  1425. fonts are 12-point Helvetica**, 10-point Times Roman Bold, and 12-point 
  1426. Courier** Italic. 
  1427.  
  1428. To use fonts in an application, first create a logical font.  A logical font 
  1429. can be used only by the applications that defines it, and is lost when the 
  1430. presentation space is deleted.  The logical font describes the typeface and 
  1431. other characteristics of the font and then assigns the font to the 
  1432. application's presentation space by passing to it a unique local identifier. 
  1433. (The identifier is a number in the range 1 through 254.) 
  1434.  
  1435.  
  1436. ΓòÉΓòÉΓòÉ 1.5.3.4. Logical Color Palette ΓòÉΓòÉΓòÉ
  1437.  
  1438. A logical color palette is an array of colors that an application uses when 
  1439. drawing graphics.  Any primitive or other graphic you draw has one of the 
  1440. colors given in the table.  You specify the color by giving a color index.  The 
  1441. index identifies the table entry, defining the color you want.  Every 
  1442. presentation space has a default color palette when it is created, but you can 
  1443. create a logical color palette to replace it if you need other colors. Creating 
  1444. a new palette associates the color indexes with whatever colors you have 
  1445. specified in the corresponding palette entry. 
  1446.  
  1447.  
  1448. ΓòÉΓòÉΓòÉ 1.5.3.5. Clipping ΓòÉΓòÉΓòÉ
  1449.  
  1450. Clipping is a process that limits graphics output to a specific region on the 
  1451. display screen or on a page of printer paper. You can use clipping with a 
  1452. presentation space by creating a clipping area.  The clipping area is the 
  1453. region where the output is to appear.  You can create this area by setting the 
  1454. dimensions of the graphics field and viewing limits, or by creating a clip path 
  1455. or clip region.  A clip path is used to define a curved clipping area in world 
  1456. coordinates.  A clip region is useful when an application must clip an area 
  1457. shaped like a rectangle or like a number of intersecting rectangles. If an 
  1458. application tries to draw output outside the clipping area, the system will 
  1459. "clip" the output, preventing it from appearing on the drawing surface of the 
  1460. output device. 
  1461.  
  1462.  
  1463. ΓòÉΓòÉΓòÉ 1.5.3.6. Transformation ΓòÉΓòÉΓòÉ
  1464.  
  1465. A transformation defines how the system should map the points of one coordinate 
  1466. space into another.  A coordinate space is a two-dimensional set of points used 
  1467. to generate output on a video display or printer.  Because all graphics 
  1468. primitives and other drawing objects use coordinate spaces, a transformation 
  1469. affects the way all graphics are drawn by your application.  For example,  you 
  1470. can use a transformation to move a figure from one place to another on the 
  1471. display screen or to rotate or adjust the size of the figure. Transformations 
  1472. typically are used to give the user different perspectives of a single drawing, 
  1473. or to create rotated or sheared figures that would be time-consuming for the 
  1474. application to plot and draw. 
  1475.  
  1476.  
  1477. ΓòÉΓòÉΓòÉ 1.5.4. Drawing ΓòÉΓòÉΓòÉ
  1478.  
  1479. You draw graphics by using the OS/2 drawing functions.  A drawing function 
  1480. draws a primitive or other graphic, applying the primitive attributes that were 
  1481. current when the primitive was defined. For example, if the line color is 
  1482. changed between the defining of the two lines, each line will be drawn in its 
  1483. own color.  Lines, for example, also have a line style attribute. The style 
  1484. determines whether the line is solid or a series of dashes, dots, or both. 
  1485.  
  1486. Some attributes apply to all graphics primitives.  For example, the foreground 
  1487. and background colors and mix modes affect all primitives. The foreground color 
  1488. defines the color of the primitive and the background color defines the color 
  1489. "behind" the primitive. For a line drawn with a dashed style, the dashes have 
  1490. the foreground color, and the gaps between the dashes have the background 
  1491. color.  The mix modes define how the foreground and background colors are 
  1492. combined with colors already present.  The mix mode can cause the color to 
  1493. overpaint the existing color, ignore it, or mix it by using a binary operator, 
  1494. such as the exclusive-OR operator. 
  1495.  
  1496. Some attributes are specific to a particular graphics primitive.  For example, 
  1497. the arc parameters apply only to arcs.  The arc parameters specify a 
  1498. transformation that maps a circle to another circle, ellipse, or similar shape. 
  1499. When you draw an arc, the system uses the shape defined by the transformed 
  1500. circle as the shape for your arc.  You supply a multiplier to set the final 
  1501. size of the arc. 
  1502.  
  1503. A number of drawing functions use loadable resources to draw graphics. For 
  1504. example, the text-drawing functions, such as GpiCharString and 
  1505. GpiCharStringPos, can use a loaded font to draw text.  To make a loadable 
  1506. resource available for these functions, you typically load the resource into 
  1507. memory and create a local identifier for the resource. For example, to use a 
  1508. font resource, you load it by using the GpiLoadFonts function, and then set the 
  1509. local identifier with the GpiCreateLogFont function.  Once you have a local 
  1510. identifier, you can set the resource to be the current resource by using a 
  1511. function such as GpiSetCharSet.  Like the text-drawing functions, the marker 
  1512. and area functions can use resources when they draw. 
  1513.  
  1514.  
  1515. ΓòÉΓòÉΓòÉ 1.5.5. Retained Graphics and Segments ΓòÉΓòÉΓòÉ
  1516.  
  1517. OS/2 2.0 enables you to retain the graphics you draw in your application by 
  1518. storing them in retained segments. You create a retained segment by setting the 
  1519. drawing mode of the presentation space to DM_RETAIN or DM_DRAWANDRETAIN and 
  1520. opening the segment.  All subsequent graphics are stored in the segment (and 
  1521. are also drawn on the device, if you specified DM_DRAWANDRETAIN).  You can 
  1522. close the segment at any time and draw the contents by using a function such as 
  1523. GpiDrawSegment.  Retained segments are useful for storing graphics that the 
  1524. user provides.  Once stored, the graphics can be redrawn or edited at any time. 
  1525. An element pointer enables the application to move to a specific graphics 
  1526. element in a segment. The element can then be drawn or replaced, or new 
  1527. elements can be inserted. 
  1528.  
  1529.  
  1530. ΓòÉΓòÉΓòÉ 1.5.6. Metafiles ΓòÉΓòÉΓòÉ
  1531.  
  1532. A metafile is a file in which graphics data is stored.  It is created with a 
  1533. device context.  A device context links presentations to devices by converting 
  1534. device-independent presentation-space information into device-dependent 
  1535. information. A device context also gives applications access to important 
  1536. device information such as screen dimensions or printer capabilities. You 
  1537. associate the metafile device context with the presentation space, draw the 
  1538. graphics you want in the metafile, and then disassociate the device context 
  1539. from the presentation space and close it. Closing the metafile returns a handle 
  1540. that you can use to save the metafile in a disk file. 
  1541.  
  1542. Metafiles are useful when transferring graphics images from one computer to 
  1543. another.  An application can load a metafile from disk and transfer it into the 
  1544. application's presentation space.  The presentation space can be associated 
  1545. with any device-display or printer.  The graphics in the metafile are stored as 
  1546. graphics commands, not as a bit map, so an application can examine and extract 
  1547. portions of the metafile if necessary. 
  1548.  
  1549.  
  1550. ΓòÉΓòÉΓòÉ 1.5.7. Producing Hard-Copy Output ΓòÉΓòÉΓòÉ
  1551.  
  1552. An application can send alphanumeric and graphics data directly to a hard-copy 
  1553. device (printer or plotter), or to the spooler for printing when a suitable 
  1554. device is free.  The spooler creates print jobs and stores each as a temporary 
  1555. spool file on disk. The advantages of using the spooler are that it allows 
  1556. hard-copy devices to be shared among a number of processes in the system 
  1557. without interference.  In addition, the spooler allows relatively slow printing 
  1558. operations to take place in the background, letting foreground applications 
  1559. continue to interact with the user. See Presentation Drivers for more 
  1560. information. 
  1561.  
  1562. There are two main ways to send data to a hard-copy device. The recommended way 
  1563. is to use the device functions to create a device context to which the data is 
  1564. sent.  This method enables the application to control a print job.  For 
  1565. example, it can choose the spool queue to which the data is sent and a priority 
  1566. for the job, and it can query and subsequently use special features of the 
  1567. output device that is selected by the spooler.  For graphics applications, the 
  1568. graphics presentation space in which the data is drawn must be associated with 
  1569. the printer device context. 
  1570.  
  1571. An application can request direct printing (spooler not used) when it creates 
  1572. the printer device context.  Although this is not the recommended method, it 
  1573. enables specialized applications to use dedicated hard-copy devices that need 
  1574. not be shared with other applications running in the system. 
  1575.  
  1576. An alternative method is to use the DOS functions.  With this method, data is 
  1577. written to a spool file, if the spooler is running, or sent directly to the 
  1578. chosen printer if the spooler is not running. (Naturally, the data must be 
  1579. formatted for the print device.) However, the application has no control over 
  1580. the print job, so this method is not suitable for graphics applications. 
  1581.  
  1582. The OS/2 2.0 spooler provides improvements in system use and performance.  The 
  1583. new Spl functions improve access to spooler facilities.  Spl functions control 
  1584. the PM print-spooling system, both locally and on a network.  See the 
  1585. Presentation Manager Programming Reference, Volume I for a description of these 
  1586. functions. 
  1587.  
  1588.  
  1589. ΓòÉΓòÉΓòÉ 1.6. The OS/2 Application Programming Interface Functions ΓòÉΓòÉΓòÉ
  1590.  
  1591. The OS/2 system functions are organized into the following distinct groups: 
  1592.  
  1593. OS/2 Function Groups 
  1594.  
  1595. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1596. ΓöéGroup     ΓöéUsage                                             Γöé
  1597. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1598. ΓöéDdf       ΓöéDynamic-data formatting functions.  Use to create Γöé
  1599. Γöé          Γöéand manage online, context-sensitive help         Γöé
  1600. Γöé          Γöéinformation.  These functions let you display bothΓöé
  1601. Γöé          Γöétext and graphics and set up hypertext links      Γöé
  1602. Γöé          Γöébetween information units.                        Γöé
  1603. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1604. ΓöéDev       ΓöéPM device functions.  Use to open and control PM  Γöé
  1605. Γöé          Γöédevice drivers.  These functions let you create   Γöé
  1606. Γöé          Γöédevice contexts that you can associate with a     Γöé
  1607. Γöé          Γöépresentation space and use with the Gpi functions Γöé
  1608. Γöé          Γöéto carry device-independent graphics operations   Γöé
  1609. Γöé          Γöéfor displays, printers, and plotters.             Γöé
  1610. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1611. ΓöéDos       ΓöéControl Program functions.  Use in full-screen andΓöé
  1612. Γöé          ΓöéPresentation Manager sessions to read from and    Γöé
  1613. Γöé          Γöéwrite to disk files, to allocate memory, to start Γöé
  1614. Γöé          Γöéthreads and processes, to communicate with other  Γöé
  1615. Γöé          Γöéprocesses, and to access computer devices         Γöé
  1616. Γöé          Γöédirectly.  Most functions in this group can be    Γöé
  1617. Γöé          Γöéused in PM applications.                          Γöé
  1618. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1619. ΓöéDrg       ΓöéDirect manipulation functions.  Use to move       Γöé
  1620. Γöé          Γöégraphical representations (OS/2 icons, for        Γöé
  1621. Γöé          Γöéexample) around the screen using a pointing       Γöé
  1622. Γöé          Γöédevice, such as a mouse.  Drg functions let you   Γöé
  1623. Γöé          Γöéinitialize the structures that convey the         Γöé
  1624. Γöé          Γöénecessary information about each object to the    Γöé
  1625. Γöé          Γöétarget and which describe the image to be         Γöé
  1626. Γöé          Γöédisplayed during the drag operation. They provide Γöé
  1627. Γöé          Γöéthe system with the type, rendering mechanism,    Γöé
  1628. Γöé          Γöésuggested name, container or folder name, name,   Γöé
  1629. Γöé          Γöétrue type, and native rendering mechanism of the  Γöé
  1630. Γöé          Γöéobjects being manipulated.                        Γöé
  1631. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1632. ΓöéGpi       ΓöéGraphic-programming-interface functions.  Use to  Γöé
  1633. Γöé          Γöécreate graphics output for a display, a printer,  Γöé
  1634. Γöé          Γöéor other output devices.  The Gpi functions give  Γöé
  1635. Γöé          Γöéyou a full range of graphic primitives, from linesΓöé
  1636. Γöé          Γöéto complex curves to bit maps.  You choose the    Γöé
  1637. Γöé          Γöéattributes for the primitives (such as color, lineΓöé
  1638. Γöé          Γöéwidth, and pattern) and then draw lines,          Γöé
  1639. Γöé          Γöécharacter, and shapes.  The retained-graphics     Γöé
  1640. Γöé          Γöécapability lets you save the drawings in segments Γöé
  1641. Γöé          Γöéand build complex pictures by drawing a chain of  Γöé
  1642. Γöé          Γöésegments.                                         Γöé
  1643. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1644. ΓöéPrf       ΓöéProfile functions.  Use to tailor some of the     Γöé
  1645. Γöé          Γöéaspects of the system, including the names of     Γöé
  1646. Γöé          Γöéports, printers, printer drivers, and queues.  PrfΓöé
  1647. Γöé          Γöéfunctions also enable you to change the spooler   Γöé
  1648. Γöé          Γöépath, screen colors, the default printer and      Γöé
  1649. Γöé          Γöéqueue, the program list, and application settings.Γöé
  1650. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1651. ΓöéSpl       ΓöéSpooler functions.  Use to allow your applicationsΓöé
  1652. Γöé          Γöéto write data direct to a spool file.  This means Γöé
  1653. Γöé          Γöéthat data by-passes the presentation driver, so itΓöé
  1654. Γöé          Γöémust be in a format that the printer can          Γöé
  1655. Γöé          Γöéunderstand.  Your applications must format the    Γöé
  1656. Γöé          Γöédata.                                             Γöé
  1657. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1658. ΓöéWin       ΓöéWindow-manager functions.  Use to create and      Γöé
  1659. Γöé          Γöémanage windows. PM applications use windows as theΓöé
  1660. Γöé          Γöémain interface with the user.  Win functions let  Γöé
  1661. Γöé          Γöéyou create menus, scroll bars, and dialog boxes   Γöé
  1662. Γöé          Γöéthat let the user select commands and supply      Γöé
  1663. Γöé          Γöéinput.  Your application receives all mouse and   Γöé
  1664. Γöé          Γöékeyboard input as messages from the message queue.Γöé
  1665. Γöé          ΓöéWin functions let you retrieve messages from the  Γöé
  1666. Γöé          Γöéqueue and dispatch them to the window for which   Γöé
  1667. Γöé          Γöéthe input is intended.                            Γöé
  1668. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1669.  
  1670. The OS/2 system functions give applications access to all the features of the 
  1671. operating system. These features, such as windows, device-independent graphics, 
  1672. and multitasking, enable you to create applications that make optimal use of 
  1673. the computer's memory, display, and processor while still meeting the needs of 
  1674. a wide range of users through either the traditional character-based interface 
  1675. or the PM graphical user interface. 
  1676.  
  1677. From the application's perspective, the code for each API function looks like a 
  1678. subroutine that can be called by name using an inter-segment near call.  The 
  1679. subroutine that implements the API call is not part of the application's 
  1680. executable file. Relocation pointers to the subroutines are contained in a 
  1681. dynamic link library (DLL), which is described in Dynamic Linking. The loader 
  1682. fills in the addresses of the subroutines and prepares the executable for 
  1683. execution. 
  1684.  
  1685. Before making an API call, the application pushes parameters onto an execution 
  1686. stack. After control is returned to the calling application, any error code is 
  1687. in the EAX register.  By contrast, a PM application is returned data 
  1688. immediately in the EAX register, if the result of the call is a doubleword. 
  1689.  
  1690. The call-return method of accessing system services has the following 
  1691. advantages: 
  1692.  
  1693. o The application can call functions directly, eliminating the need for a 
  1694.   DOS-style function router. 
  1695.  
  1696. o The application's executable file is smaller than it would be if it contained 
  1697.   all the code to implement the API calls. 
  1698.  
  1699. o The API can be changed easily without affecting existing applications. 
  1700.  
  1701. The implication is that the API can be extended with a new set of API 
  1702. functions.  In fact, whether the kernel controls a function, or it is contained 
  1703. in a DLL, the mechanics of the API are the same.  Following certain 
  1704. conventions, a developer can extend or replace an I/O subsystem. 
  1705.  
  1706. The OS/2 2.0 Control Program Programming Reference and Presentation Manager 
  1707. Programming Reference contain a comprehensive, alphabetical listing of all the 
  1708. API functions, including their input and output parameters, error return codes, 
  1709. data structures, and messages. 
  1710.  
  1711.  
  1712. ΓòÉΓòÉΓòÉ 2. The 32-bit OS/2 Programming Environment ΓòÉΓòÉΓòÉ
  1713.  
  1714. This chapter describes: 
  1715.  
  1716. o Intel** 80386 architecture 
  1717.  
  1718. o How OS/2 2.0 takes advantage of the 80386 
  1719.  
  1720.    - Flat memory model 
  1721.    - Process address space 
  1722.    - Memory objects 
  1723.    - Paging 
  1724.    - Compatibility with 16-bit OS/2. 
  1725.  
  1726.  
  1727. ΓòÉΓòÉΓòÉ 2.1. Intel 80386 Architecture ΓòÉΓòÉΓòÉ
  1728.  
  1729. The Intel** 80386 is a powerful 32-bit microprocessor that forms the basis for 
  1730. OS/2 2.0.  The 80386 incorporates multitasking support, sophisticated memory 
  1731. management, pipelined architecture, address translation caching, and a 
  1732. high-speed bus interface, all combined within the processor chip.  While the 
  1733. 80386 represents a significant improvement over previous generations of Intel 
  1734. microprocessors, it retains software compatibility with older 16-bit 
  1735. microprocessors such as the 8086 and 80286 families. 
  1736.  
  1737. The capacity of the 80386 processor is substantial in comparison with 80286 
  1738. processors, as shown in the following list: 
  1739.  
  1740. o 4, 5, or 6 million instructions per second (MIPS). 
  1741.  
  1742.   Note:  Sustained rate at clock speeds of 16, 20 and 25 MHz. 
  1743.  
  1744. o 4 Gigabyte physical address space, compared with the maximum of 16 Megabytes 
  1745.   available on the 80286. 
  1746.  
  1747. o 64 Terabyte virtual address space, compared with the 1 Gigabyte available on 
  1748.   the 80286. 
  1749.  
  1750. o Ability to handle memory objects from 1 byte to 4 Gigabytes in size, compared 
  1751.   to segments of 16 bytes to 64 Kilobytes on the 80286. 
  1752.  
  1753. o Paged memory management using 4 Kilobyte pages, compared to the 80286, which 
  1754.   offers only segmented memory management. 
  1755.  
  1756. This chapter presents an overview of the 80386 processor architecture to serve 
  1757. as a basis for understanding the changes made in OS/2 2.0.  More detailed 
  1758. information about the 80386 can be found in the following publications: 
  1759.  
  1760. o Intel 80386 Hardware Reference Manual (ISBN 1-55512-069-5) 
  1761.  
  1762. o Intel 386 DX Programmer's Guide (ISBN 1-55512-082-2) 
  1763.  
  1764. o IBM PS/2 Model 80 Technical Reference (IBM P/N 84X1508). 
  1765.  
  1766.  
  1767. ΓòÉΓòÉΓòÉ 2.1.1. Physical Characteristics ΓòÉΓòÉΓòÉ
  1768.  
  1769. The 80386 processor consists of six dedicated units: 
  1770.  
  1771. o Bus interface unit 
  1772. o Code prefetch unit 
  1773. o Instruction decode unit 
  1774. o Execution unit 
  1775. o Segmentation unit 
  1776. o Paging unit. 
  1777.  
  1778. These individual units are connected by 32-bit buses and operate in parallel to 
  1779. provide a 6-stage pipelined execution of instructions.  This implies that up to 
  1780. six different instructions can be held concurrently within the chip, at 
  1781. different stages of execution.  To further improve performance, the 80386 uses 
  1782. on-chip caching and implements sophisticated memory management and bit 
  1783. manipulation (such as a 64-bit barrel shifter) in the hardware. 
  1784.  
  1785. The 80386 chip contains eight 32-bit general registers.  To provide 
  1786. compatibility with the 8086 and 80286 processors, the 80386 provides the 
  1787. capability to use the lower-order 16 bits of these registers, or the upper and 
  1788. lower 8 bits of these registers, to represent the 16-bit registers used in the 
  1789. previous processors, as illustrated in the following figure. 
  1790.  
  1791. 80386 General, Segment, and Status Registers 
  1792.  
  1793. Programs running in virtual 8086 mode can utilize the full register set of the 
  1794. 80386 (all 32-bit registers, including the new FS, GS, debug, control, and test 
  1795. registers).  The programs also can use instructions with 32-bit operands by 
  1796. using the size prefix. 
  1797.  
  1798. The 80386 also provides six 16-bit segment registers that are used to contain 
  1799. segment selectors, thus enabling the same segmented memory model used in the 
  1800. 80286 processor.  The FS and GS segment registers are new in the 80386. 
  1801.  
  1802. Both the instruction pointer (EIP) register and the flags (EFLAGS) register are 
  1803. 32-bit. 
  1804.  
  1805. Applications written for the 80286 run unmodified on the 80386 because the 
  1806. 80286 instructions, addresses, limits, segment types, and so forth, are a full 
  1807. subset of those available in 80386, and run in 16-bit mode automatically.  The 
  1808. 80386 handles this very simply: if the upper word (16 bits) of a memory 
  1809. reference is 0, then that reference must be an 80286 reference. 
  1810.  
  1811. The registers described above are available to application programmers, either 
  1812. directly using assembly language or indirectly through the use of higher-level 
  1813. programming languages.  The 80386 processor provides a number of additional 
  1814. registers that normally are not available to applications but can be used by 
  1815. operating systems and system software. 
  1816.  
  1817. o The 80386 provides the following four memory management registers: 
  1818.  
  1819.    - Global Descriptor Table Register (GDTR) 
  1820.    - Local Descriptor Table Register (LDTR) 
  1821.    - Interrupt Descriptor Table Register (IDTR) 
  1822.    - Task Register (TR) 
  1823.  
  1824.   These registers contain pointers to data structures used by the segmented 
  1825.   memory model, allowing compatibility with software written for the 80286 
  1826.   processor. 
  1827.  
  1828. o Four control registers (CR0 to CR3) are used to contain pointers to data 
  1829.   structures used by the paged memory model and for status information.  These 
  1830.   registers are new in the 80386 processor, since previous processors did not 
  1831.   support the paged memory model. 
  1832.  
  1833. o Eight debug registers (DR0 to DR7) and two test registers (TR6 and TR7) are 
  1834.   provided to aid in real-time system and application debugging. These 
  1835.   registers are also new in the 80386. 
  1836.  
  1837.  
  1838. ΓòÉΓòÉΓòÉ 2.1.2. Memory Addressing ΓòÉΓòÉΓòÉ
  1839.  
  1840. The 80386 processor, like its predecessor the 80286, can operate in two 
  1841. addressing modes; real mode or protect mode. The memory addressing schemes used 
  1842. in each of these modes are described in the following sections. 
  1843.  
  1844.  
  1845. ΓòÉΓòÉΓòÉ 2.1.2.1. Real Mode ΓòÉΓòÉΓòÉ
  1846.  
  1847. When the 80386 is powered up or re-initialized via a hardware reset, the 
  1848. processor is set into real mode.  In real mode, the 80386 effectively operates 
  1849. as a 16-bit processor.  Program addresses correspond directly to physical 
  1850. memory addresses.  Memory is addressed using the segmented memory model only 
  1851. (paging is not supported), and the system's physical address space is limited 
  1852. to 1MB of real memory.  Virtual memory is not supported in real mode. 
  1853.  
  1854. The use of physical memory addresses directly by applications prevents any 
  1855. protection being applied by the processor to memory references. Hence 
  1856. applications executing in real mode may access one another's memory, or that of 
  1857. the operating system. 
  1858.  
  1859. Segment registers are used to supply the base address for each type of memory 
  1860. segment (DS - data segment, CS - code segment, SS - stack segment and ES - 
  1861. extra segment). The following figure shows how a segment is addressed in real 
  1862. mode. 
  1863.  
  1864. Real Mode Addressing 
  1865.  
  1866. Each memory reference consists of a 16-bit segment address and a 16-bit offset. 
  1867. The processor automatically adds four binary zeros to the segment selector 
  1868. value (equivalent to multiplying by 16) to obtain a segment base address in 
  1869. memory.  Thus a segment may start on any 16-byte boundary within the 1MB 
  1870. physical address space. 
  1871.  
  1872. The required memory location within the segment is determined by adding the 
  1873. offset to the segment base address.  Since the offset is 16 bits in length, the 
  1874. maximum offset (and therefore the maximum size of a segment) is 64KB. 
  1875.  
  1876.  
  1877. ΓòÉΓòÉΓòÉ 2.1.2.2. Protect Mode (Segmented Memory Model) ΓòÉΓòÉΓòÉ
  1878.  
  1879. When the 80386 is switched to protect mode by software command, the full 32-bit 
  1880. capabilities of the processor are enabled, and the system's physical address 
  1881. space is increased to 4GB.  Since virtual memory support is enabled in protect 
  1882. mode, the virtual address space visible to an application increases to a 
  1883. theoretical maximum of 64 Terabytes. 
  1884.  
  1885. Note:  In OS/2 2.0, this is is limited to 512MB per process to reserve memory 
  1886.        for operating system use and to retain full compatibility with 
  1887.        applications written for previous versions of the operating system, 
  1888.        which used 16-bit addressing. 
  1889.  
  1890. Each process occupies a separate logical address space, and the 80386 provides 
  1891. full memory protection between the address spaces of different processes, 
  1892. thereby preventing an application from inadvertently accessing and/or 
  1893. corrupting memory used by another application.  Be aware, however, that under 
  1894. OS/2 2.0, multiple threads can be created within a single process, and 
  1895. dispatched independently by the operating system.  These threads share a common 
  1896. address space, and it is therefore the responsibility of the application 
  1897. developer to ensure correct behavior of and synchronization between multiple 
  1898. threads within a single process. 
  1899.  
  1900. In protect mode, the full 32 bits of the segment registers are used. These no 
  1901. longer contain the segment base address; rather, they contain a value that 
  1902. indexes a descriptor table, which in turn refers to the physical memory 
  1903. location of the segments.  The lower-order 16 bits of the register contain the 
  1904. segment selector that identifies the segment, and the higher-order 16 bits are 
  1905. used internally to maintain control information about the segment. 
  1906.  
  1907. Of the 16 bits that make up the segment selector, 2 bits are used to specify 
  1908. the privilege level of the segment, and 1 bit is used to select between the 
  1909. Global Descriptor Table (GDT) and a Local Descriptor Table (LDT).  The GDT is 
  1910. used by the operating system or privileged software to maintain control over 
  1911. all segments within the system.  A unique LDT is maintained for each process 
  1912. and used to control only the memory segments used by that process.  This way, 
  1913. each process is prevented from accessing the memory used by another process. 
  1914.  
  1915. The remaining 13 bits are used as an index into the appropriate descriptor 
  1916. table, where the physical memory address of the segment is stored.  This 
  1917. results in a total of 8192 entries per descriptor table. 
  1918.  
  1919. A memory address is made up of the segment selector plus a 32-bit offset, which 
  1920. is added to the segment base address determined from the descriptor table, to 
  1921. produce a 32-bit linear address. This address translation operation is shown in 
  1922. the following figure. 
  1923.  
  1924. Protect Mode Addressing-Without Paging 
  1925.  
  1926. The maximum allowable value for the offset, and thus the maximum size of a 
  1927. segment, is defined by two things.  Each entry in a descriptor table contains a 
  1928. 20-bit limit field.  These 20 bits allow a maximum segment size of 1MB, using 
  1929. the byte as the unit of size. 
  1930.  
  1931. However, the descriptor table entry also contains a granularity bit, which 
  1932. specifies that either the byte or the page may be used as the unit of size in 
  1933. the limit field. When using page granularity, the 20 bits in the limit field 
  1934. represent a multiple of 4KB, allowing a segment size of 4KB to 4GB.  Since the 
  1935. GDT (which contains all segments in the system) may contain up to 8192 entries, 
  1936. this results in a total system virtual address space of 64 Terabytes. 
  1937.  
  1938. Notice, however, that OS/2 2.0 does not use the 80386 segmented memory model. 
  1939. Rather, it uses the 32-bit flat memory model, which results in a system global 
  1940. address space of 4GB.  This reduces the complexities of application programming 
  1941. that are inherent in the segmented memory model, and increases the potential 
  1942. for portability of the operating system and application code to other hardware 
  1943. platforms.  The maximum memory accessible by an application in the system, 
  1944. known as the process address space, is 512MB, which allows full compatibility 
  1945. with applications developed for previous versions of the operating system. 
  1946.  
  1947.  
  1948. ΓòÉΓòÉΓòÉ 2.1.2.3. Protect Mode (Flat Memory Model) ΓòÉΓòÉΓòÉ
  1949.  
  1950. The 80386 can address very large memory (up to 4GB) in a single segment. 
  1951. Therefore, it might be desirable not to use the normal segmented memory model, 
  1952. but to use the entire system memory as a single linear address range.  While 
  1953. the 80386 does not have a mode bit for disabling segmentation, the same effect 
  1954. can be achieved by mapping the stack, code, and data spaces to a single range 
  1955. of linear addresses.  When this is done, the 32-bit offsets used by 80386 
  1956. memory references can cover the entire linear address space. 
  1957.  
  1958. OS/2 2.0 uses this technique to implement a flat addressing model. The 
  1959. operating system effectively creates a single code segment and a single data 
  1960. segment, with the base address of each segment selector set to 0 (or any other 
  1961. address designated as a relative 0 address), and a segment size of 4GB.  This 
  1962. is equivalent to setting the same segment selector into the CS, DS, ES, FS, and 
  1963. SS registers.  The selectors for these segments are allocated in the GDT; 
  1964. therefore, the offsets are equivalent to linear memory addresses. The advantage 
  1965. of using such a technique is that it greatly simplifies memory management 
  1966. within an application, since the application developer need not be concerned 
  1967. with the internal implementation of data structures as segments with a defined 
  1968. maximum size.  The use of a flat memory model also facilitates migration of the 
  1969. operating system and application code to other hardware platforms, because the 
  1970. code is not explicitly designed around the segmented memory model. 
  1971.  
  1972.  
  1973. ΓòÉΓòÉΓòÉ 2.1.3. Paging ΓòÉΓòÉΓòÉ
  1974.  
  1975. In addition to the segmented memory management offered on the earlier 80286 
  1976. processors, the 80386 provides a paged memory model.  This is an optional 
  1977. function of the 80386, and there are no direct performance implications if an 
  1978. operating system chooses not to use paged memory.  However, the paged memory 
  1979. model provides significant performance benefits when running large applications 
  1980. which make extensive use of virtual memory. 
  1981.  
  1982. Under previous versions of the operating system, the smallest unit of memory 
  1983. (for memory management purposes) was the segment, since the operating system 
  1984. was designed to execute on the 80286 processor and use the segmented memory 
  1985. model.  With the 80286, segments can vary in size between 16 bytes and 64KB; 
  1986. therefore, there is danger of having a large amount of free memory that is 
  1987. fragmented into small, discontiguous units. Previous versions of OS/2 manage 
  1988. this by moving segments in real storage to create a larger free space, and by 
  1989. swapping unused segments to disk until they are required.  This entails a high 
  1990. degree of overhead for the operating system.  With an 80386 processor, segments 
  1991. can be up to 4GB in size, and, potentially, the overhead can result in an 
  1992. unacceptable performance impact, particularly for applications with very large 
  1993. segments. 
  1994.  
  1995. To avoid this situation, the 80386 processor provides a paged memory model, 
  1996. implemented in hardware through a dedicated paging unit on the chip.  A page is 
  1997. a 4KB unit of contiguous memory, and replaces the segment as the unit of 
  1998. granularity for memory management, including swapping to and from disk.  Paging 
  1999. is available in protect mode in conjunction with both the segmented and flat 
  2000. memory models. 
  2001.  
  2002. Using the paged memory model, an application makes a memory reference in the 
  2003. normal way, using either the segmented memory model or the flat memory model. 
  2004. In the case of a segmented memory model, the segmentation unit in the processor 
  2005. automatically resolves the reference into a 32-bit value.  However, this does 
  2006. not represent a linear address, but is comprised as follows: 
  2007.  
  2008. o The high-order 10 bits of the field are used as an index into a Page 
  2009.   Directory table.  In turn, the entry in this table refers to the base address 
  2010.   of a Page Table. 
  2011.  
  2012. o The next 10 bits of the field are used as an index into the Page Table 
  2013.   referred to by the Page Directory entry.  The entry in the Page Table 
  2014.   provides the physical base address of a 4KB page. 
  2015.  
  2016. o The lower-order 12 bits of the field are used as an offset within the page 
  2017.   referred to by the Page Table entry. 
  2018.  
  2019. Protect Mode Addressing-With Paging 
  2020.  
  2021. Both the Page Directory and Page Tables contain 32-bit page specifiers. The 
  2022. Page Directory and Page Tables themselves are contained within single pages 
  2023. and, therefore, can contain a maximum of 1024 entries.  So, each page directory 
  2024. can access up to 4GB of storage, which is the maximum physical address space of 
  2025. the 80386. 
  2026.  
  2027. Pages can be shared between processes by defining them in the Page Tables of 
  2028. each process.  This is done at the Page Table level rather than the Page 
  2029. Directory level, in order to share only the individual pages required. 
  2030.  
  2031. To further reduce the overhead involved in looking up page references, the 
  2032. 80386 provides a hardware-based address-caching mechanism for paging 
  2033. information.  This is known as the Translation Lookaside Buffer (TLB).  The TLB 
  2034. contains the physical addresses for the 32 most-recently-used pages, therefore 
  2035. permitting very fast access to these pages because it bypasses the normal page 
  2036. translation process.  Use of the TLB is handled entirely within the paging unit 
  2037. and is not visible to software. 
  2038.  
  2039.  
  2040. ΓòÉΓòÉΓòÉ 2.1.4. Protection ΓòÉΓòÉΓòÉ
  2041.  
  2042. The 80386 processor implements 5 different types of protection for tasks 
  2043. executing within the system, as follows: 
  2044.  
  2045. o Type checking 
  2046. o Limit checking 
  2047. o Privilege levels 
  2048. o Restriction of procedure entry points 
  2049. o Restriction of instruction set. 
  2050.  
  2051. Each instruction and memory reference is checked by the hardware to ensure 
  2052. compliance with the protection rules prior to execution.  For memory 
  2053. references, checking is performed during the address translation process, and 
  2054. is applied to both segmented and paged memory models. Protection parameters are 
  2055. stored in the segment descriptors or in the Page Directory and Page Table 
  2056. entries. 
  2057.  
  2058.  
  2059. ΓòÉΓòÉΓòÉ 2.1.4.1. Type Checking ΓòÉΓòÉΓòÉ
  2060.  
  2061. With each descriptor, there is a type field that is used to distinguish between 
  2062. the different descriptor formats.  This field also specifies the intended use 
  2063. of a segment.  For example, the allowable types for data segments are: 
  2064.  
  2065. o Read-Only 
  2066. o Read/Write 
  2067. and for code segments: 
  2068.  
  2069. o Execute-Only 
  2070. o Execute/Read 
  2071. The type field ensures that segments are used only in the ways they are 
  2072. intended.  For example: 
  2073.  
  2074. o The code segment (CS) register can be loaded only with the selector of an 
  2075.   executable segment. 
  2076.  
  2077. o Selectors of executable segments that are not defined as readable cannot be 
  2078.   loaded into data segment (DS, ES, FS, and GS) registers. 
  2079.  
  2080. o No instruction can write into an executable segment. 
  2081.  
  2082. o No instruction can write into a data segment unless that segment is defined 
  2083.   as Read/Write. 
  2084.  
  2085. o No instruction can read an executable segment unless that segment is defined 
  2086.   as Execute/Read. 
  2087.  
  2088.  
  2089. ΓòÉΓòÉΓòÉ 2.1.4.2. Limit Checking ΓòÉΓòÉΓòÉ
  2090.  
  2091. The limit field in each segment descriptor is used by the processor to prevent 
  2092. a program from addressing memory outside the segment by using an overly large 
  2093. offset value.  During address translation, the offset value specified in the 
  2094. memory reference is compared with the limit field; an exception is generated if 
  2095. the offset is larger than the limit for that segment.  The limit field, in 
  2096. general, prevents errors in one program from corrupting other programs' code or 
  2097. data areas. 
  2098.  
  2099.  
  2100. ΓòÉΓòÉΓòÉ 2.1.4.3. Privilege Levels ΓòÉΓòÉΓòÉ
  2101.  
  2102. The 80386 implements a 4-level protection mechanism.  Level 0 is the most 
  2103. privileged, and Level 3 is the least privileged.  The 4 levels can be 
  2104. visualized as concentric rings, with the most privileged level in the center. 
  2105. All code and data segments in the system are assigned a privilege level, which 
  2106. is stored in the segment descriptor.  At any one moment, a task executes on 
  2107. only 1 of the 4 levels: 
  2108.  
  2109. Level 0   This is the most privileged level, and code executing on this level 
  2110.           can use all protect-mode processor instructions.  This level is used 
  2111.           by those routines in an operating system that are essential for 
  2112.           resource allocation and control.  This part of the system often 
  2113.           referred to as the kernel or nucleus. 
  2114.  
  2115. Level 1   This is the second most privileged level and normally is used for the 
  2116.           remainder of the operating system routines and for the Input/Output 
  2117.           support routines.  Notice that Level 1 is not used by OS/2 2.0. 
  2118.  
  2119. Level 2   This level typically is used as the application services level.  It 
  2120.           should be used for routines that do not belong to the operating 
  2121.           system, but should still be protected from user code, such as 
  2122.           communications support and database management programs. 
  2123.  
  2124. Level 3   This is the least privileged level and should be assigned to user 
  2125.           application program code. 
  2126.  
  2127. A task executing at one protection level cannot access data at a more 
  2128. privileged level (Level 3 cannot access data at Level 1), nor can it invoke a 
  2129. procedure at a less privileged level (Level 1 cannot invoke Level 3).  Thus, 
  2130. both access to data and transfer of control are restricted in appropriate ways. 
  2131. The processor interprets the protection parameters and automatically performs 
  2132. all the checking necessary to implement this protection. 
  2133.  
  2134.  
  2135. ΓòÉΓòÉΓòÉ 2.1.4.4. Restriction of Procedure Entry Points ΓòÉΓòÉΓòÉ
  2136.  
  2137. To achieve transfer of control between procedures on different privilege 
  2138. levels, a descriptor type called a gate is provided. Programs wanting to 
  2139. transfer control call the gate by specifying a segment base address, rather 
  2140. than transferring control directly to the required procedure. 
  2141.  
  2142. The 4 types of gates are CALL, TASK, INTR (Interrupt), and TRAP.  The routine 
  2143. invoked when a gate is called redirects control to the new address that 
  2144. contains the privileged routine to be executed. 
  2145.  
  2146. From the program's point of view, this is no different from transferring 
  2147. control to another code segment, since the calling instruction regards the gate 
  2148. as another segment.  However, it effectively isolates the calling procedure 
  2149. from the called procedure; and since only the base address is supplied in the 
  2150. calling instruction, the calling procedure has no access to any point other 
  2151. than the defined entry point of the called procedure. 
  2152.  
  2153. Calls are verified to ensure that they satisfy the following two conditions: 
  2154.  
  2155.  1. The call must enter the called procedure at the beginning of that 
  2156.     procedure; this is normally ensured by the gate descriptor itself, which 
  2157.     supplies the necessary offset to the entry point. 
  2158.  
  2159.  2. The code segment for the called procedure must have the same privilege 
  2160.     level as the gate descriptor. 
  2161.  
  2162.  
  2163. ΓòÉΓòÉΓòÉ 2.1.4.5. Reserved Instructions ΓòÉΓòÉΓòÉ
  2164.  
  2165. Certain processor instructions are reserved for execution by the operating 
  2166. system only and, therefore, might execute only at privilege level 0.  Such 
  2167. instructions include HLT (Halt Processor), LGDT (Load GDT), and LTR (Load Task 
  2168. Register). 
  2169.  
  2170. In addition, some I/O instructions are restricted, as follows: 
  2171.  
  2172.  1. The IOPL field in the EFLAGS register defines whether or not the current 
  2173.     task has the right to use I/O-related instructions. 
  2174.  
  2175.  2. The I/O Permission Bit Map in the TSS determines whether the current task 
  2176.     can use ports in the I/O address space. 
  2177.  
  2178.  
  2179. ΓòÉΓòÉΓòÉ 2.1.5. Interrupts ΓòÉΓòÉΓòÉ
  2180.  
  2181. When the processor is running in protect mode, interrupts are not vectored from 
  2182. the base of memory.  Instead, each interrupt has a code which is used as an 
  2183. index into an Interrupt Descriptor Table (IDT), the base address of which is 
  2184. contained in the Interrupt Descriptor Table Register.  There may be up to 256 
  2185. interrupt and exception codes, generated by devices or by software. At system 
  2186. initialization, the IDT is loaded into memory by the operating system, and its 
  2187. location is stored in the IDT Register.  Each descriptor in the IDT specifies 
  2188. the address of the interrupt handler routine which will service interrupts with 
  2189. that code. 
  2190.  
  2191. There are three types of gate descriptors in the IDT: 
  2192.  
  2193. o Interrupt 
  2194. o Trap 
  2195. o Task. 
  2196.  
  2197. For interrupt and trap gates, the descriptor in the IDT contains the selector 
  2198. of the gate and points indirectly to a procedure that will execute in the 
  2199. current task, since the selector in the gate procedure points directly to an 
  2200. executable segment descriptor in the GDT or the current LDT.  This takes place 
  2201. exactly as though the 80386 were calling a procedure within the current 
  2202. application. For the task gate however, the selector within the gate points to 
  2203. a TSS descriptor in the GDT.  Invoking the task gate causes a task switch to 
  2204. occur.  There are certain advantages to using a task gate, such as its 
  2205. permitting a program to pass control to a higher privilege level, and the 
  2206. application, therefore, to invoke operating system routines to process 
  2207. interrupts and exceptions.  In addition, the new task can be given its own LDT 
  2208. to prevent it from accessing memory used by the current task, and the TSS of 
  2209. the current task is saved automatically. 
  2210.  
  2211. However, there also are performance implications using task switching. 
  2212. Interrupt handling through task switching requires approximately 15 
  2213. microseconds on a 20 MHz 80386, while switching to a procedure within the 
  2214. current task takes about 3.6 microseconds.  But the advantages of having the 
  2215. operating system manage exceptions (smaller application code, greater 
  2216. portability, standard exception handling) typically outweigh the slight 
  2217. performance penalty. 
  2218.  
  2219.  
  2220. ΓòÉΓòÉΓòÉ 2.1.6. Input/Output Processing ΓòÉΓòÉΓòÉ
  2221.  
  2222. I/O addressing on the 80386 can be performed either by issuing specific I/O 
  2223. instructions to the I/O address space or issuing general-purpose memory 
  2224. manipulation instructions to memory-mapped I/O. 
  2225.  
  2226. The I/O address space is separate from the linear physical memory and the I/O 
  2227. instructions do not go through the segmentation or paging hardware. The I/O 
  2228. address space is 64KB in size.  It may be mapped in various ways; for instance, 
  2229. 64KB of individually addressable 8-bit ports, 32KB of 16-bit ports, 16KB of 
  2230. 32-bit ports, or any combination of the above up to the maximum allowed 64KB. 
  2231. The processor can transfer 32 bits of data at a time to a device located in the 
  2232. I/O address space, using the IN, OUT, INS and OUTS commands. 
  2233.  
  2234. The I/O address space has two protection mechanisms: 
  2235.  
  2236.  1. The I/O Privilege Level (IOPL) field in the EFLAGS register controls access 
  2237.     to the I/O instructions. 
  2238.  
  2239.     The IN, INS, OUT, OUTS, CLI and STI instructions are only allowed to 
  2240.     execute if the CPL (Current Privilege Level in the CS descriptor for the 
  2241.     active task) is less than or equal to the value of the IOPL field. 
  2242.  
  2243.     Only system code (privilege level 0) can change the IOPL value. 
  2244.  
  2245.  2. The I/O permission bit map in the active TSS controls access to individual 
  2246.     ports in the I/O address space. 
  2247.  
  2248.     There is one bit for each 8-bit port in the I/O address space, which means 
  2249.     that the I/O permission bit map could be up to 64 Kilobits (8 KB).  If a 
  2250.     task references an I/O port and the corresponding bit is on, the processor 
  2251.     signals a general protection exception.  The exception can then be handled 
  2252.     by the system software to initiate an exception handling procedure within 
  2253.     the current task, or to initiate a new task, which will redirect the I/O. 
  2254.  
  2255.     By changing bits in the I/O permission bit map of different tasks' TSSs, an 
  2256.     operating system can allocate ports to tasks and avoid having two tasks use 
  2257.     the same port concurrently. 
  2258.  
  2259.  
  2260. ΓòÉΓòÉΓòÉ 2.1.7. Virtual 8086 Mode ΓòÉΓòÉΓòÉ
  2261.  
  2262. The 80386 processor supports concurrent execution of one or more 8086 programs 
  2263. within the protect mode environment.  There is no longer a need for the 
  2264. processor to switch back to real mode in order to simulate a 8086 machine. 
  2265.  
  2266. An 8086 program runs in protect mode as part of a virtual 8086 task.  Virtual 
  2267. 8086 tasks are able to take advantage of the 80386 hardware support for 
  2268. multitasking, offered in protect mode.  Virtual 8086 tasks may execute 
  2269. concurrently with one another and with other protect mode tasks in the system. 
  2270.  
  2271. The purpose of the virtual 8086 task is to form a virtual machine for running 
  2272. programs written for  the 8086 processor.  A complete virtual machine consists 
  2273. of the 80386 processor support, plus additional support from operating system 
  2274. software: 
  2275.  
  2276. o The hardware provides a set of virtual registers (implemented through the 
  2277.   TSS), a virtual memory space (the first 1MB of the 32-bit linear address 
  2278.   space) and directly executes all instructions that deal with these registers 
  2279.   and with this address space. The following figure shows the way in which the 
  2280.   memory used by virtual 8086 machines is mapped into the system's physical 
  2281.   address space. 
  2282.  
  2283. o The operating system software controls the external interfaces of the virtual 
  2284.   machine (I/O, interrupts and exceptions).  In the case of I/O, the operating 
  2285.   system can choose either to emulate I/O instructions or to let the hardware 
  2286.   execute them directly. 
  2287.  
  2288. Virtual 8086 Environment-Memory Management 
  2289.  
  2290. Virtual 8086 tasks execute at privilege level 3 (lowest) and are subject to all 
  2291. of the protection checks defined in protect mode, thereby preventing an 
  2292. ill-behaved application from accessing and potentially corrupting memory used 
  2293. by other tasks in the system. 
  2294.  
  2295. All I/O is normally handled through the I/O Permission Map in the 80386 TSS for 
  2296. both virtual 8086 applications and other protect mode applications.  This means 
  2297. that any call to I/O services generates an exception which is trapped by the 
  2298. 80386 and may then be handled by the operating system.  Any unauthorized calls 
  2299. can be trapped in the operating system, thus preventing an ill-behaved 
  2300. application from hanging the system. In addition, the 80386 paging hardware 
  2301. permits virtual 8086 tasks to share segments. 
  2302.  
  2303.  
  2304. ΓòÉΓòÉΓòÉ 2.1.8. Numeric Co-processor ΓòÉΓòÉΓòÉ
  2305.  
  2306. The 80386 processor may operate in conjunction with, and utilize the features 
  2307. of either the Intel 80287 or 80387 numeric co-processors.  When the system is 
  2308. initialized, the presence of a numeric co-processor, and its type if present, 
  2309. is checked by the 80386.  If an 80287 co-processor is detected, the 80386 
  2310. automatically converts all memory transfers to 16-bit format. 
  2311.  
  2312. Note:  IBM does not support or recommend the use of 80287 numeric co-processors 
  2313.        in 80386-based systems.  For a list of supported numeric co-processors 
  2314.        for each system unit, readers should refer to the appropriate IBM 
  2315.        Product Announcement for that system unit. 
  2316.  
  2317. If an 80387 is detected, it is used in 32-bit mode, thereby utilizing the full 
  2318. potential of both the 80386 and 80387. 
  2319.  
  2320.  
  2321. ΓòÉΓòÉΓòÉ 2.1.9. Co-processing ΓòÉΓòÉΓòÉ
  2322.  
  2323. Besides the Intel 80287 and 80387 numeric co-processors, the 80386 supports 
  2324. multiple 80386 processors within the same system, sharing memory and other 
  2325. resources. This support is provided through the LOCK prefix instruction.  When 
  2326. specified in conjunction with another instruction, the LOCK prefix instruction 
  2327. ensures that the locking processor has exclusive use of the requested resource. 
  2328.  
  2329. Only a few 80386 instructions can be used with the LOCK prefix instruction.  It 
  2330. is typically used to prefix instructions like BTC (Bit Test and Complement) 
  2331. where it locks the area of memory defined by the destination operand for as 
  2332. many cycles as necessary to update the entire operand. 
  2333.  
  2334. In several instances, the processor itself automatically locks activities on 
  2335. the data bus.  For example, when acknowledging interrupts, switching tasks, 
  2336. loading descriptors from the LDT to the segment selector and updating the page 
  2337. table ACCESS and DIRTY bits, the required memory pages are locked since these 
  2338. are highly critical operations. 
  2339.  
  2340. The 80386 includes on-chip memory caching to improve performance.  The 
  2341. processor must therefore allow for the case where data in shared memory is 
  2342. modified and where that data is currently recorded in a cache on another 
  2343. processor.  In such situations, the 80386 employs an interprocess or interrupt 
  2344. to let other processors know when such a change has been made. 
  2345.  
  2346. This is normally done by using one of the physical address pins on the chip, 
  2347. and having the receiving processor implement a task switch when it receives 
  2348. this signal.  The task switch clears the system registers, reloads the new 
  2349. descriptors and invalidates the memory cache in the processor. 
  2350.  
  2351. Notice that by changing the function of one of the addressing pins, the 
  2352. physical addressing capability of the processor is reduced to 2GB. 
  2353.  
  2354.  
  2355. ΓòÉΓòÉΓòÉ 2.2. OS/2 and the 80386 Processor ΓòÉΓòÉΓòÉ
  2356.  
  2357. OS/2 2.0 is the first version of the OS/2 operating system to take advantage of 
  2358. the 32-bit features of the Intel 80386 microprocessor. Applications, 
  2359. subsystems, and the operating system can utilize the full register set of the 
  2360. 80386, 32-bit instructions and addressing modes, and memory objects larger than 
  2361. 64KB. 
  2362.  
  2363. In OS/2 2.0, processes view memory as a large linear address space addressable 
  2364. by 32-bit offsets from the beginning of memory.  That is why the OS/2 2.0 
  2365. memory model is known as the "0:32 memory model," or the flat memory model. 
  2366. 16-bit OS/2 uses the 16:16 model for addressing memory, in which a segment and 
  2367. the offset into that segment must be specified in order to address a single 
  2368. byte of memory.  The flat model effectively hides all segmentation from the 
  2369. 32-bit programmer, resulting in a portable programming model with much higher 
  2370. performance than a segmented system can provide. 
  2371.  
  2372. The high performance of applications, subsystems, and the operating system 
  2373. using the flat model is derived from several areas.  In the segmented or 16-bit 
  2374. model, segment registers have to be reloaded with selectors every time a 
  2375. different 64KB of memory needs to be accessed. These selector-load operations 
  2376. are very expensive in protect mode on 80X86 processors because of the checking 
  2377. that must occur to ensure segment protection.  In the flat model, a 32-bit 
  2378. offset relative to the base of the linear address space is used to address any 
  2379. byte of memory without reloading any selectors; 32-bit programs and subsystems 
  2380. do not use or know about segment registers. 
  2381.  
  2382. Another benefit of the flat model is that there is only one memory model for 
  2383. applications (small with no 64KB restriction) instead of the many models 
  2384. (small, medium, large, huge) used in previous versions of the OS/2 operating 
  2385. system and all other systems that target 8088 and 80286 microprocessors. 
  2386.  
  2387.  
  2388. ΓòÉΓòÉΓòÉ 2.2.1. Process Address Space ΓòÉΓòÉΓòÉ
  2389.  
  2390. In the 16-bit version of the operating system, a process address space consists 
  2391. of a collection of segments mapped by a Local Descriptor Table (LDT).  A 
  2392. byte-addressable segment is the basic unit of allocation and sharing.  In the 
  2393. 32-bit version of the operating system, a processes address space consists of a 
  2394. single, large ring 3 segment that the process addresses using the 32-bit 
  2395. offsets. 
  2396.  
  2397. The size of the process address space in OS/2 2.0 is 512MB. Protected memory 
  2398. reduces this to 448MB.  This restriction is required to maintain compatibility 
  2399. with the 16-bit version of the operating system. The following figure shows the 
  2400. process address space in the flat memory model. 
  2401.  
  2402.  
  2403.                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2404.              ΓöîΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé
  2405.           ΓöîΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé  Γöé
  2406.        ΓöîΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé  Γöé  Γöé
  2407.     4G Γöé            System            Γöé  Γöé  Γöé  Γöé
  2408.        Γöé  (shared by all processes)   Γöé  Γöé  Γöé  Γöé
  2409.  512MB Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé  Γöé  Γöé
  2410.        Γöé       Shared Region          Γöé  Γöé  Γöé  Γöé
  2411.        Γöé                              Γöé  Γöé  Γöé  Γöé
  2412.        Γöé  DLL  Code                   Γöé  Γöé  Γöé  Γöé
  2413.        Γöé  DLL  Global Data            Γöé  Γöé  Γöé  Γöé
  2414.        Γöé  DLL  Instance Data          Γöé  Γöé  Γöé  Γöé
  2415.        Γöé  DLL  Resources              Γöé  Γöé  Γöé  Γöé One process
  2416.        Γöé  DLL  Runtime Share Data     Γöé  Γöé  Γöé  Γöé address space
  2417.        Γöé  EXE  Runtime Share Data     Γöé  Γöé  Γöé  Γöé per process
  2418.        Γöé             Γöé                Γöé  Γöé  Γöé  Γöé
  2419.        Γöé                             Γöé  Γöé  Γöé  Γöé
  2420.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé  Γöé  Γöé
  2421.        Γöé  Unallocated Area            Γöé  Γöé  Γöé  Γöé
  2422.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé  Γöé  Γöé
  2423.        Γöé                             Γöé  Γöé  Γöé  Γöé
  2424.        Γöé             Γöé                Γöé  Γöé  Γöé  Γöé
  2425.        Γöé       Private Region         Γöé  Γöé  Γöé  Γöé
  2426.        Γöé                              Γöé  Γöé  Γöé  Γöé
  2427.        Γöé  EXE  Code                   Γöé  Γöé  Γöé  Γöé
  2428.        Γöé  EXE  Data                   Γöé  Γöé  Γöé  Γöé
  2429.        Γöé  EXE  Resources              Γöé  Γöé  Γö£ΓöÇΓöÇΓöÿ
  2430.        Γöé  EXE  Runtime Private Data   Γöé  Γö£ΓöÇΓöÇΓöÿ
  2431.        Γöé  DLL  Runtime Private Data   Γö£ΓöÇΓöÇΓöÿ
  2432.      0 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2433.  
  2434. OS/2 2.0 Process Address Space 
  2435.  
  2436. Notice in the previous figure that the system is at the top of each process 
  2437. address space. Anytime an application attempts to use an address larger than 
  2438. 512MB or an address that has not been allocated, an access fault is generated. 
  2439. The process address space itself is divided into private and shared regions, 
  2440. much like the LDTs in 16-bit OS/2.  Shared memory allocations grow down from 
  2441. the top of the address space, whereas private allocations grow up from the 
  2442. bottom of the address space. While the shared and private address spaces grow 
  2443. toward each other, they are not allowed to overlap.  Private and shared address 
  2444. spaces have a guaranteed minimum size of 64MB.  This means that shared 
  2445. addresses may not be allocated within the first 64MB of the address space, and 
  2446. private addresses may not be allocated within the last 64MB of the 512MB 
  2447. address space. 
  2448.  
  2449.  
  2450. ΓòÉΓòÉΓòÉ 2.2.2. Memory Objects and Memory Sharing ΓòÉΓòÉΓòÉ
  2451.  
  2452. In the flat memory model, the unit of memory allocation and sharing is called a 
  2453. memory object.  Memory objects are: 
  2454.  
  2455. o Not relocatable 
  2456. o Allocated in units of 4KB (page size) 
  2457. o Aligned in linear space on 4KB (page size) boundaries. 
  2458.  
  2459. Instead of being divided into segments as it is in 16-bit OS/2, memory is 
  2460. divided into memory objects that consist of one or more 4KB pages. 
  2461.  
  2462. These characteristics imply that memory objects must be allocated with an upper 
  2463. bound specified for their size, and that memory allocation reserves this linear 
  2464. space for that object.  The size of a memory object is defined when the object 
  2465. is created.  After a memory object is created, its virtual address does not 
  2466. grow or shrink beyond its initially defined size. 
  2467.  
  2468. Because sharing is done by sharing linear addresses, a shared memory object's 
  2469. linear address range is reserved in all process address spaces.  Instance data 
  2470. is allocated in one of the shared address regions with private pages behind it. 
  2471. Instance data is treated as a memory object and is either page or page table 
  2472. aligned, depending on the performance characteristics required. The following 
  2473. figure shows how memory objects are mapped into the process address spaces 
  2474. provided by the system and shows the relationship between private and shared 
  2475. regions. 
  2476.  
  2477. Memory objects might not be allocated at specific addresses during runtime. 
  2478. However, both private and shared memory objects defined in an EXE program 
  2479. module file are allocated in the private virtual address space and can be 
  2480. allocated at specific addresses that are defined in the EXE file format. 
  2481. Because of the 64MB minimum private address space size, a program module can 
  2482. specify the addresses of its memory within this address space and be guaranteed 
  2483. the linear addresses will be available during program load.  Specific 
  2484. allocations above the first 64MB might not succeed because the desired 
  2485. addresses might be occupied by shared memory objects. 
  2486.  
  2487. The only way to guarantee that a specific linear address range will be reserved 
  2488. for a program's use is to define a memory object in the program module EXE file 
  2489. that spans the desired linear address range. As long as a program module uses 
  2490. only the address space below 64MB, the system will guarantee the ability to 
  2491. reserve the specific linear addresses using this mechanism. This feature does 
  2492. not apply to DLLs. 
  2493.  
  2494.  
  2495.        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöÇΓöÉ
  2496.     4G Γöé             System             Γöé  Γöé
  2497.        Γöé    (shared by all processes)   Γöé  Γöé
  2498.  512MB Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé
  2499.        Γöé         Shared Region          Γöé  Γöé   Addresses
  2500.        Γöé                                Γöé  Γö£ΓöÇ  shared by
  2501.        Γöé                                Γöé  Γöé   all processes
  2502.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé
  2503.        Γöé instance Γöé instance Γöé instance Γöé  Γöé
  2504.        Γöé   data   Γöé   data   Γöé   data   Γöé  Γöé
  2505.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ ΓöÇΓöñ
  2506.        Γöé          Γöé          Γöé          Γöé  Γöé
  2507.        Γöé          Γöé          Γöé          Γöé  Γöé
  2508.        Γöé          Γöé          Γöé          Γöé  Γöé
  2509.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé   Addresses
  2510.        Γöé private  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ runtime  Γöé  Γö£ΓöÇ  private to
  2511.        Γöé   EXE    Γöé private  Γöé private  Γöé  Γöé   each process
  2512.        Γöé   code   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé
  2513.        Γöé   and    Γöé          Γöé          Γöé  Γöé
  2514.        Γöé   data   Γöé    shared EXE code  Γöé  Γöé
  2515.        Γöé          Γöé          Γöé          Γöé  Γöé
  2516.      0 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓöÇΓöÿ
  2517.         Process 1  Process 2  Process 3
  2518.  
  2519. Multiple Linear Address Space Management 
  2520.  
  2521. Reserved linear address ranges are invalid to address until memory has been 
  2522. committed for the address range.  The commitment of memory to an address range 
  2523. makes the address range valid to access, the decommitment of memory from an 
  2524. address range makes the address range invalid to access.  The reservation of a 
  2525. linear address range does not guarantee that memory resources will be available 
  2526. to commit to the reserved address range. 
  2527.  
  2528. The backing storage for a range of pages may be committed and decommitted 
  2529. within a previously allocated private or shared memory object.  This allows an 
  2530. application to make specific address ranges within an object valid or invalid 
  2531. as the application sees fit. Commitment and decommitment always take place on a 
  2532. page granularity. To assist an application or library in its management of 
  2533. committed memory, the system can provide the system page size through the 
  2534. DosQuerySysInfo function. 
  2535.  
  2536. The operating system does not use the virtual address as the protection domain, 
  2537. and therefore never checks to ensure that an argument data structure resides 
  2538. within a single private or shared memory object.  In general passing an 
  2539. argument that crosses multiple memory objects is considered poor behavior and 
  2540. should be avoided. Also the locking mechanism provided for device drivers for 
  2541. DMA does not permit a device driver to lock memory that crosses multiple memory 
  2542. objects.  Therefore even though the system does not prevent an argument from 
  2543. spanning multiple objects, an API call can fail if it does. 
  2544.  
  2545.  
  2546. ΓòÉΓòÉΓòÉ 2.2.3. Page Attributes and Memory Access Protection ΓòÉΓòÉΓòÉ
  2547.  
  2548. Page-level memory protection is one of the significant differences between the 
  2549. 32-bit flat memory model and the 16-bit segmented model.  In the 16-bit 
  2550. segmented model, protection exists on a per-segment basis. Access and limit 
  2551. checks occur on each segment selector load.  Within the flat model, however, 
  2552. because an application's memory objects exist within the same segment, the 
  2553. Intel segment protection semantics are bypassed.  Page-level protection is used 
  2554. to manage the memory within a process's address space, but only for DLLs. 
  2555.  
  2556. When allocating memory using the flat model, an application can control the 
  2557. attributes of the pages within the range of addresses spanned by the allocated 
  2558. memory object.  The commitment of memory to an address range may also be 
  2559. controlled by the application so that specific address ranges within a memory 
  2560. object can be made valid or invalid as the application sees fit.  If an invalid 
  2561. page is addressed, an access fault occurs. Commitment, decommitment, and 
  2562. changing of the attributes of a page are done on a page granularity.  To assist 
  2563. applications and libraries in their management of committed memory, OS/2 2.0 
  2564. provides the system page size (4KB on an 80386).  The following summarizes the 
  2565. attributes that can be associated with a single page or group of pages within a 
  2566. memory object: 
  2567.  
  2568. COMMIT         Page is committed with backing storage. 
  2569.  
  2570. DECOMMIT       Page is not committed and access will cause an access fault 
  2571.  
  2572. EXECUTE        Execute access to the committed page is allowed. 
  2573.  
  2574. READ           Read access to the committed page is allowed. 
  2575.  
  2576. WRITE          Write access to the committed page is allowed. 
  2577.  
  2578. GUARD          The committed page is a guard page. 
  2579.  
  2580. On the 80386, execute and read access are equivalent, and write access implies 
  2581. both read and execute access.  The guard page attribute is used to facilitate 
  2582. automatic stack growth and stack limit checking, but may be used by an 
  2583. application in other data structures where appropriate. Because a memory object 
  2584. can contain some committed and some decommitted pages, sparse memory objects 
  2585. can be used with the flat memory model. 
  2586.  
  2587. While the paging feature of the 80386 is used to support the flat model and 
  2588. multiple DOS address spaces, it also allows OS/2 2.0 to provide a different 
  2589. kind of memory overcommitment than previous versions of the operating system. 
  2590. In 16-bit OS/2, segment swapping is used to keep the system running in 
  2591. memory-stressed conditions.  Due to the I/O performance of most fixed disks, 
  2592. however, segment swapping does not perform well enough to provide generic 
  2593. virtual storage on demand.  The 80386, in comparison, provides paging.  From a 
  2594. system perspective, a lot of storage can be virtualized on fixed disk media at 
  2595. a much lower I/O cost because the size of a page is fixed and is smaller than 
  2596. that of a segment.  The system also can do a better job of tracking memory 
  2597. usage because memory paging algorithms operate on a page granularity instead of 
  2598. a segment granularity.  For these reasons, OS/2 2.0 is a demand-paged virtual 
  2599. storage system which is designed so that the system runs acceptably in 
  2600. overcommitted situations. 
  2601.  
  2602.  
  2603. ΓòÉΓòÉΓòÉ 2.2.4. Compatibility with 16-Bit OS/2 ΓòÉΓòÉΓòÉ
  2604.  
  2605. OS/2 2.0 runs all 16-bit OS/2 applications and subsystems.  To do this, 16-bit 
  2606. and 32-bit modules reside simultaneously.  For 16-bit and 32-bit modules to 
  2607. coexist, however, memory must be addressable from each model.  This means that 
  2608. a high-performance mechanism for converting 16-bit addresses to 32-bit 
  2609. addresses and vice versa is needed.  The technique used to deal with address 
  2610. conversions between the segmented and flat memory models is called LDT tiling. 
  2611.  
  2612. A tiled LDT contains at most 8192 descriptors where each descriptor maps a 64K 
  2613. region of the process address space and the regions mapped by these descriptors 
  2614. are contiguous in the linear address space. The result is that a single LDT can 
  2615. map, at most,  512MB of contiguous linear address space in the flat model. 
  2616. (This is why OS/2 2.0 restricts the size of the process address space to 
  2617. 512MB.) 
  2618.  
  2619. This tiling of the LDT creates an address mapping between the 16:16 address and 
  2620. the 0:32 address for any byte of memory in the process address space. The 
  2621. following figure shows how 16-bit segments are allocated in the process address 
  2622. space and mapped into the LDT. 
  2623.  
  2624. Tiled Address Space Next to LDT 
  2625.  
  2626. To make this address mapping work, the LDT is managed differently in 32-bit 
  2627. OS/2 than in 16-bit OS/2.  In 16-bit OS/2 the LDT selectors for private and 
  2628. shared memory are interspersed in the LDT.  The LDT in 32-bit OS/2 is managed 
  2629. sparsely;  private selectors are allocated from one end of the LDT while shared 
  2630. selectors are allocated from the other.  This does not affect the compatibility 
  2631. of 16-bit modules, because their segmented nature makes them relocatable by 
  2632. default. 
  2633.  
  2634. The memory manager puts all 16-bit API memory requests on 64KB linear 
  2635. boundaries and sets up the LDT to access the memory as described.  This 
  2636. guarantees that the system can satisfy 16-bit DosReallocSeg requests up to the 
  2637. 64KB maximum. Notice in the previous figure that each 16-bit segment takes up 
  2638. at least one page of virtual and physical memory, as well as one page on the 
  2639. swap device.  Therefore, 16-bit applications that create many small segments 
  2640. will fragment the pages that constitute the address space. More memory is 
  2641. consumed than when the same application is run on 16-bit OS/2, although part of 
  2642. this memory fragmentation effect is reduced because the system swaps pages 
  2643. instead of segments.  The trade-off is necessary, however, to provide a 
  2644. high-performance mechanism for address sharing between the two different memory 
  2645. models. 
  2646.  
  2647. The following API functions are used to convert addresses between the 16-bit 
  2648. and 32-bit models: 
  2649.  
  2650. o DosSelToFlat 
  2651. o DosFlatToSel 
  2652.  
  2653.   Note:  See DosSelToFlat and DosFlatToSel for more information on using these 
  2654.   API functions. 
  2655.  
  2656. LDT tiling also provides a mechanism for 32-bit applications to utilize 16-bit 
  2657. DLLs.  32-bit modules can quickly create 16:16 aliases for memory objects. 
  2658. Because the aliasing is formula-based, a mapping layer can be provided for 
  2659. 16-bit DLLs.  A function that performs this mapping is called a thunk. 
  2660.  
  2661.  
  2662. ΓòÉΓòÉΓòÉ 2.3. Summary ΓòÉΓòÉΓòÉ
  2663.  
  2664. The 80386 is a powerful 32-bit microprocessor that forms the basis of OS/2 2.0. 
  2665. It consists of six dedicated units connected by 32-bit buses operating in 
  2666. parallel.  This enables up to six different instructions to be held 
  2667. concurrently within the chip.  In addition, the 80386 processor contains eight 
  2668. 32-bit registers (which are compatible with 8086 and 80286 processors) and six 
  2669. 16-bit registers.  Other features of the 80386 processor include: 
  2670.  
  2671. o The ability to operate in two addressing modes: real and protect.  In real 
  2672.   mode, the 80386 operates as a 16-bit processor.  In protect mode, the 
  2673.   processor can take advantage of 32-bit capabilities, such as the ability to 
  2674.   address very large memory in a single segment and to manage memory as pages, 
  2675.   not as segments. 
  2676.  
  2677. o The ability to support a multitasking environment. 
  2678.  
  2679. o A greater degree of protection for tasks executing within the system.  The 
  2680.   types of protection are type checking, limit checking, privilege levels, 
  2681.   restriction of procedure entry points, and restriction of the instruction 
  2682.   set. 
  2683.  
  2684. o Improved interrupt handling. 
  2685.  
  2686. o The ability to perform I/O addressing either by issuing specific I/O 
  2687.   instructions to the I/O space, or issuing general-purpose memory manipulation 
  2688.   instructions to memory-mapped I/O. 
  2689.  
  2690. o Support for concurrent execution of one or more 8086 programs within the 
  2691.   protect-mode environment. 
  2692.  
  2693. o The ability to operate in conjunction with and utilize the features of either 
  2694.   the Intel 80287 or 80387 numeric co-processor. 
  2695.  
  2696. OS/2 2.0 takes advantage of the 32-bit features of the 80386 processor.  It 
  2697. uses the 32-bit instruction and addressing modes of the 80386 processor to 
  2698. implement a flat memory model  The flat memory model provides the following 
  2699. benefits: 
  2700.  
  2701. o Larger process space (512MB) 
  2702.  
  2703. o Division of memory into memory objects instead of segments.  Memory objects 
  2704.   consist of one or more 4KB pages. 
  2705.  
  2706. o Page-level protection. 
  2707.  
  2708. OS/2 2.0 maintains compatibility with previous versions of the operating 
  2709. system.  This makes it possible for 16-bit and 32-bit modules to coexist; 
  2710. however, memory must be addressable from each model.  The technique used to 
  2711. convert between 16-bit and 32-bit addresses is called LDT tiling. 
  2712.  
  2713.  
  2714. ΓòÉΓòÉΓòÉ 3. The Application Development Environment ΓòÉΓòÉΓòÉ
  2715.  
  2716. This chapter describes: 
  2717.  
  2718. o Types of applications that can run under OS/2 2.0 
  2719.  
  2720. o Programming models for OS/2 2.0 applications 
  2721.  
  2722. o Program development environment for OS/2 2.0 
  2723.  
  2724. o Issues the programmer faces in migrating to the 32-bit OS/2 programming 
  2725.   model. 
  2726.  
  2727.  
  2728. ΓòÉΓòÉΓòÉ 3.1. Applications Running Under OS/2 ΓòÉΓòÉΓòÉ
  2729.  
  2730. Two forms of input and output are supported with 32-bit functions:  the C 
  2731. interface (producing command-line-based applications that can be run in a text 
  2732. window or full screen) and PM applications.  Applications that must create 
  2733. graphics, handle keyboard or mouse input, or intercept or modify device 
  2734. information should do so within the context of the PM functions.  The 32-bit PM 
  2735. programming model is the preferred programming model for OS/2 2.0 applications. 
  2736. Although OS/2 2.0 can execute any application developed for version 1.X of the 
  2737. operating system, only 32-bit PM applications can take full advantage of the 
  2738. graphical user interface and the 32-bit features of OS/2 2.0. The types of 
  2739. applications supported by OS/2 2.0 are shown in the following figure and table. 
  2740.  
  2741. OS/2 2.0 Application Types 
  2742.  
  2743. OS/2 2.0 Application Types 
  2744.  
  2745. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2746. ΓöéFull-screen             ΓöéRuns in non-PM session              Γöé
  2747. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2748. Γöé                        ΓöéPredominantly text-based            Γöé
  2749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2750. Γöé                        ΓöéDirect hardware access              Γöé
  2751. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2752. Γöé                        ΓöéMay use hardware text modes         Γöé
  2753. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2754. Γöé                        ΓöéMay use restricted PM functions     Γöé
  2755. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2756. Γöé                        ΓöéDOS programming model               Γöé
  2757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2758. ΓöéWindowable              ΓöéRuns in a PM session                Γöé
  2759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2760. Γöé                        ΓöéText only                           Γöé
  2761. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2762. Γöé                        ΓöéHardware access using OS/2 APIs     Γöé
  2763. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2764. Γöé                        ΓöéMay use hardware text modes         Γöé
  2765. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2766. Γöé                        ΓöéMay use restricted PM functions     Γöé
  2767. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2768. Γöé                        ΓöéDOS programming model               Γöé
  2769. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2770. ΓöéPM                      ΓöéRuns in a PM session                Γöé
  2771. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2772. Γöé                        ΓöéMay use advanced text capabilities  Γöé
  2773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2774. Γöé                        ΓöéMay use PM graphics functions       Γöé
  2775. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2776. Γöé                        ΓöéPM programming model                Γöé
  2777. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2778. ΓöéDOS/Windows             ΓöéRuns in DOS (V86) session           Γöé
  2779. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2780. Γöé                        ΓöéText and graphics                   Γöé
  2781. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2782. Γöé                        ΓöéDirect hardware access              Γöé
  2783. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2784. Γöé                        ΓöéMay use hardware text modes         Γöé
  2785. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2786. Γöé                        ΓöéDOS programming model               Γöé
  2787. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2788.  
  2789.  
  2790. ΓòÉΓòÉΓòÉ 3.1.1. Full-Screen Applications ΓòÉΓòÉΓòÉ
  2791.  
  2792. Full-screen applications do not run in the PM windows.  A full-screen 
  2793. application is any OS/2 application that does not create a PM message queue. 
  2794. In other words, it is an application that does not rely on the PM mouse and 
  2795. keyboard processing for input. 
  2796.  
  2797. Most full-screen applications use the DOS functions to perform input, output, 
  2798. memory management, and other activities.  Full-screen applications also 
  2799. commonly use the standard-input, standard-output, and standard-error files 
  2800. created for them when they start.  They can also use PM functions that do not 
  2801. require a message queue. 
  2802.  
  2803. Full-screen VIO applications use the video (Vio), mouse (Mou), and keyboard 
  2804. (Kbd) functions to take complete control of the screen and input devices. 
  2805. Taking complete control is useful for programs that provide their own windowing 
  2806. system or their own high-speed graphics package.  Although the video, mouse, 
  2807. and keyboard functions are not available as 32-bit functions under OS/2 2.0, 
  2808. full-screen VIO applications can still use some of the 32-bit features of OS/2 
  2809. 2.0. 
  2810.  
  2811.  
  2812. ΓòÉΓòÉΓòÉ 3.1.2. Windowable Applications ΓòÉΓòÉΓòÉ
  2813.  
  2814. A windowable application is a full-screen application that also can run in a PM 
  2815. window.  Although the application runs in a window, it does not create the 
  2816. window.  Instead, the system creates the window and provides the input and 
  2817. output to the application just as if it were running in a full-screen session. 
  2818. A full-screen application can run in a window only if it does not use functions 
  2819. that directly access the devices that PM controls.  For example, an application 
  2820. that attempts to retrieve the address of the video buffer or to change video 
  2821. modes cannot be made windowable. 
  2822.  
  2823. Windowable applications do not take direct advantage of menus, icons, screen, 
  2824. mouse, or other features available in PM.  They are usually command-line 
  2825. programs or simple text programs, and they are often ported from operating 
  2826. systems that have text-based interfaces, such as the C library input-and-output 
  2827. routine, printf.  Windowable applications can use some of the 32-bit features 
  2828. of OS/2 2.0. 
  2829.  
  2830.  
  2831. ΓòÉΓòÉΓòÉ 3.1.3. PM Applications ΓòÉΓòÉΓòÉ
  2832.  
  2833. A PM application is any OS/2 application that creates a message queue. Because 
  2834. a window is the only means a PM application has to receive input and display 
  2835. output, PM applications create one or more windows to interact with the user. 
  2836.  
  2837. All OS/2 PM applications have essentially the following structure: 
  2838.  
  2839. o A main procedure 
  2840. o One or more window procedures 
  2841. o Optional functions to support the main procedure and/or the window procedures 
  2842. The following figure shows a PM application template. 
  2843.  
  2844.  
  2845. PM Application Template
  2846.  
  2847. Main Procedure
  2848. {
  2849. Initialize PM anchor block          (WinInitialize)
  2850.  
  2851. Create a message queue              (WinCreateMsgQueue)
  2852.  
  2853. Register the window procedure for
  2854.    application's window class       (WinRegisterClass)
  2855.  
  2856. Create the application's frame
  2857.    window, defining its controls,
  2858.    client window and resources      (WinCreateStdWindow)
  2859.  
  2860. Process messages from the
  2861.    application queue and direct them
  2862.    to the window procedures.        (WinGetMsg,
  2863.                                      WinDispatchMsg)
  2864. Close and destroy the application
  2865.    resources                        (WinDestroyMsgQueue,
  2866.                                      WinDestroyWindow,
  2867.                                      WinTerminate)
  2868. }
  2869.  
  2870. Window Procedure
  2871. {
  2872. Process messages or pass them on to
  2873.    the default window procedure.    (WinDefWindowProc)
  2874. }
  2875.  
  2876. Because nearly all PM applications create and use windows, the main function 
  2877. carries out the same basic tasks in most applications.  The typical main 
  2878. function does the following: 
  2879.  
  2880. o Register each thread that calls PM functions.  Threads are registered with 
  2881.   the system by calling the WinInitialize function.  This function creates an 
  2882.   anchor block and returns an anchor-block handle that the thread can use in 
  2883.   subsequent functions. 
  2884.  
  2885.   Note:  An anchor block is a data area reserved for internal PM resources for 
  2886.   each thread that makes calls to PM functions.  This data area is defined and 
  2887.   managed by PM.  It includes instance data in which to store the process's 
  2888.   environment and storage for error messages. 
  2889.  
  2890. o Create the message queue by using the WinCreateMsgQueue function. This 
  2891.   function returns a queue handle that can be used in subsequent functions. 
  2892.   When the queue is created, the application can register a window class, 
  2893.   create a window, and start the message loop. 
  2894.  
  2895. o Enter the main message loop.  The application waits there for messages to 
  2896.   appear in the queue, retrieves them, and dispatches them, as appropriate, to 
  2897.   its windows.  When the user or system chooses to terminate an application, a 
  2898.   WM_QUIT message is used to trigger an exit from the message loop. 
  2899.  
  2900. o Carry out various termination activities, including destroying windows, 
  2901.   releasing memory, destroying message queues, closing files, and severing 
  2902.   connections with the shell and other applications. 
  2903.  
  2904. Applications written for PM have full access to the complete set of user 
  2905. interface tools:  menus, icons, scroll bars, and so on, and often present a 
  2906. WYSIWYG (what-you-see-is-what-you-get) view of their data. PM applications 
  2907. often make extensive use of a mouse and display and have access to all the 
  2908. 32-bit features of OS/2 2.0. 
  2909.  
  2910.  
  2911. ΓòÉΓòÉΓòÉ 3.1.4. DOS/Windows Applications ΓòÉΓòÉΓòÉ
  2912.  
  2913. Most DOS/Windows** applications can be run in an OS/2 2.0 DOS session, in the 
  2914. virtual 8086 mode of the 80386 microprocessor.  The virtual 8086 mode provides 
  2915. a high degree of I/O and memory protection, so that the crash of a DOS/Windows 
  2916. application running in an OS/2 2.0 DOS Session does not crash the entire 
  2917. operating system as well.  DOS/Windows applications can be run in full-screen 
  2918. or windowed DOS sessions.  Multiple DOS/Windows applications can run 
  2919. concurrently, with background DOS/Windows applications not suspended, but 
  2920. multitasked like OS/2 applications.  DOS/Windows applications can also 
  2921. communicate with PM through the system clipboard, and to other applications 
  2922. through named pipes. 
  2923.  
  2924.  
  2925. ΓòÉΓòÉΓòÉ 3.2. Programming Models ΓòÉΓòÉΓòÉ
  2926.  
  2927. OS/2 2.0 applications can be classified further according to the manner in 
  2928. which they are built, as shown in the following table. 
  2929.  
  2930. OS/2 Version 2.0 Programming Models 
  2931.  
  2932. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2933. ΓöéPure 16-Bit                   ΓöéWritten in a 16-bit language  Γöé
  2934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2935. Γöé                              ΓöéBuilt using 16-bit tools      Γöé
  2936. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2937. Γöé                              Γöé16-bit EXE format             Γöé
  2938. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2939. ΓöéMixed 16-Bit                  ΓöéWritten in 16-bit C           Γöé
  2940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2941. Γöé                              ΓöéBuilt using 16-bit and 32-bit Γöé
  2942. Γöé                              Γöétools                         Γöé
  2943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2944. Γöé                              Γöé32-bit EXE format             Γöé
  2945. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2946. ΓöéPure 32-Bit                   ΓöéWritten in 32-bit C           Γöé
  2947. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2948. Γöé                              ΓöéBuilt using 32-bit tools      Γöé
  2949. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2950. Γöé                              Γöé32-bit EXE format             Γöé
  2951. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2952. ΓöéMixed 32-Bit                  ΓöéWritten in 16-bit and 32-bit CΓöé
  2953. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2954. Γöé                              ΓöéBuilt using 16-bit and 32-bit Γöé
  2955. Γöé                              Γöétools                         Γöé
  2956. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2957. Γöé                              Γöé32-bit EXE format             Γöé
  2958. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2959.  
  2960. A pure 16-bit OS/2 application can be run on a 16-bit or 32-bit OS/2 system. 
  2961. Mixed 16-bit, mixed 32-bit, and pure-32-bit applications can be run only on a 
  2962. 32-bit OS/2 system. 
  2963.  
  2964.  
  2965. ΓòÉΓòÉΓòÉ 3.2.1. Pure 16-Bit Applications ΓòÉΓòÉΓòÉ
  2966.  
  2967. As shown in the following figure, pure 16-bit OS/2 applications: 
  2968.  
  2969. o Are compiled with a 16-bit C compiler 
  2970. o Use 16-bit C run-time libraries 
  2971. o Can be a small, medium, large, or huge model 
  2972. o Use the 16-bit OS/2 API 
  2973. o Use the 16-bit OS2.H Include file 
  2974. o Are linked with the 16-bit version of OS2.LIB called OS2286.LIB 
  2975. o Are linked with the 16-bit linker 
  2976. o Have the 16-bit EXE format. 
  2977.  
  2978. Building a Pure 16-Bit Application 
  2979.  
  2980. These applications can be full-screen, windowable, or PM applications. They can 
  2981. run under the 16-bit version of the operating system, as well as under the 
  2982. 32-bit version of the operating system (that is, on machines with 80286 or 
  2983. 80386 microprocessors).  However, they cannot take advantage of the features of 
  2984. the 32-bit programming environment. They use the 16-bit segmented memory model, 
  2985. and, therefore, do not have access to the entire 32-bit virtual address space. 
  2986.  
  2987.  
  2988. ΓòÉΓòÉΓòÉ 3.2.2. Mixed 16-Bit Applications ΓòÉΓòÉΓòÉ
  2989.  
  2990. As shown in the following figure, mixed 16-bit OS/2 applications: 
  2991.  
  2992. o Are compiled with a 16-bit C compiler 
  2993. o Use 16-bit C run-time libraries 
  2994. o Can be a small, medium, large, or huge model 
  2995. o Use the 16-bit OS/2 API 
  2996. o Can use the 32-bit OS/2 API 
  2997. o Use the 16-bit OS2.H Include file 
  2998. o Are linked with the 16-bit version of OS2.LIB called OS2286.LIB 
  2999. o Are linked with the 32-bit linker 
  3000. o Have the 32-bit EXE format. 
  3001.  
  3002.   X.C
  3003. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3004. Γöé16-Bit Γöé
  3005. Γöé APIs  Γö£ΓöÇΓöÉ                    X.OBJ
  3006. Γöé       Γöé Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3007. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé  Γöé 16-Bit   Γöé     Γöé16-Bit Γöé
  3008.  OS2.H    Γö£ΓöÇΓöé   C      Γö£ΓöÇΓöÇΓöÇΓöÇΓöé APIs  Γö£ΓöÇΓöÉ
  3009. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé  Γöé Complier Γöé     Γöé       Γöé Γöé
  3010. Γöé16-Bit Γöé Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé
  3011. ΓöéIncludeΓö£ΓöÇΓöÿ                 X.DEF       Γöé
  3012. Γöé Files Γöé                  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé
  3013. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                  Γöé 16-Bit   Γöé Γöé
  3014.                            ΓöéDefinitionΓö£ΓöÇΓöñ
  3015.                            Γöé  File    Γöé Γöé
  3016.                            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé
  3017.                             OS2286.LIB  Γöé
  3018.                            ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé
  3019.                            Γöé 16-Bit   Γöé Γöé
  3020.                            Γöé  APIs    Γö£ΓöÇΓöñ
  3021.                            Γöé          Γöé Γöé                 X.EXE
  3022.                            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3023.                                         Γöé   Γöé32-Bit Γöé    Γöé32-Bit Γöé
  3024.                            ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γö£ΓöÇΓöÇΓöéLinker Γö£ΓöÇΓöÇΓöÇΓöé EXE   Γöé
  3025.                            Γöé 16-Bit C Γöé Γöé   Γöé       Γöé    Γöé       Γöé
  3026.                            Γöé Runtime  Γö£ΓöÇΓöñ   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3027.                            Γöé Library  Γöé Γöé
  3028.  Y.C                       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé
  3029. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                               Γöé
  3030. Γöé32-Bit Γöé                               Γöé
  3031. Γöé APIs  Γö£ΓöÇΓöÉ                    Y.OBJ    Γöé
  3032. Γöé       Γöé Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé
  3033. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé  Γöé 32-Bit    Γöé    Γöé32-Bit Γöé Γöé
  3034.  OS2.H    Γö£ΓöÇΓöé   C       Γö£ΓöÇΓöÇΓöÇΓöé APIs  Γö£ΓöÇΓöÿ
  3035. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé  Γöé Compiler  Γöé    Γöé       Γöé
  3036. Γöé32-Bit Γöé Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3037. ΓöéIncludeΓö£ΓöÇΓöÿ
  3038. Γöé Files Γöé
  3039. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3040.  
  3041. Building a Mixed 16-Bit Application 
  3042.  
  3043. These applications can be full-screen, windowable, or PM applications. Like 
  3044. pure 16-bit OS/2 applications, they do not have access to the entire 32-bit 
  3045. virtual address space.  Because they have a 32-bit EXE format, they must run 
  3046. under the 32-bit version of the operating system. This enables them to run 
  3047. faster and more efficiently. 
  3048.  
  3049.  
  3050. ΓòÉΓòÉΓòÉ 3.2.3. Pure 32-Bit Applications ΓòÉΓòÉΓòÉ
  3051.  
  3052. As shown in the following figure, pure 32-bit OS/2 applications: 
  3053.  
  3054. o Are compiled with a 32-bit C compiler 
  3055. o Use 32-bit C run-time libraries 
  3056. o Are the small model only 
  3057. o Use the 32-bit OS/2 API 
  3058. o Use the 32-bit OS2.H Include file 
  3059. o Are linked with 32-bit OS2386.LIB 
  3060. o Are linked with the 32-bit linker 
  3061. o Have the 32-bit EXE format. 
  3062.  
  3063. Building a Pure 32-Bit Application 
  3064.  
  3065. These applications can be windowable or PM applications.  Because they have a 
  3066. 32-bit EXE format, they can run only under the 32-bit version of the operating 
  3067. system.  Pure 32-bit applications incorporate the 32-bit, flat memory model and 
  3068. memory protection mechanisms which are common on a wide range of computer 
  3069. industry hardware platforms.  This feature allows pure 32-bit applications to 
  3070. be more easily ported to other platforms. 
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 3.2.4. Mixed 32-Bit Applications ΓòÉΓòÉΓòÉ
  3074.  
  3075. As shown in the following figure, mixed 32-bit OS/2 applications: 
  3076.  
  3077. o Are compiled with a 32-bit C compiler, with the variables aligned so that 
  3078.   they can be passed to 16-bit functions. (With IBM C Set/2*, for example, you 
  3079.   would use the /Gt + flag on the command line). 
  3080. o Use 32-bit C run-time libraries 
  3081. o Are the small model only 
  3082. o Use the 32-bit OS/2 API 
  3083. o Can use the 16-bit OS/2 API 
  3084. o Can use only the 16-bit API or the 32-bit API in a single .C file, but not 
  3085.   both, because of Include file support 
  3086. o Use the 32-bit OS2.H Include file 
  3087. o Are linked with the 32-bit version of OS2386.LIB 
  3088. o Are linked with the 32-bit linker 
  3089. o Have the 32-bit EXE format. 
  3090.  
  3091. Building a Mixed 32-Bit Application 
  3092.  
  3093. These applications can be full-screen, windowable, or PM applications. Because 
  3094. they have a 32-bit EXE format, they can run only under the 32-bit version of 
  3095. the operating system.  Mixed 32-bit OS/2 applications can access the entire 
  3096. 32-bit virtual address space. 
  3097.  
  3098.  
  3099. ΓòÉΓòÉΓòÉ 3.3. The Program Development Environment ΓòÉΓòÉΓòÉ
  3100.  
  3101. OS/2 2.0 provides different names and entry points for all 16 and 32-bit APIs. 
  3102. Therefore, it is possible to mix 16- and 32-bit code within a single EXE 
  3103. module.  It is also possible to call 32-bit APIs from a 16-bit C program (mixed 
  3104. 16-bit programming model), and to call 16-bit APIs from a 32-bit program (mixed 
  3105. 32-bit programming model).  In order to support this, two different libraries 
  3106. are provided with OS/2 2.0. 
  3107.  
  3108. OS2286.LIB     This library links to 16-bit pure/mixed applications.  It 
  3109.                contains links to the 16-bit ordinals using the 16-bit DosXXX 
  3110.                names, and links to the 32-bit API entry points using the 32-bit 
  3111.                Dos32XXX names. 
  3112.  
  3113. OS2386.LIB     This library links to 32-bit pure/mixed applications.  It 
  3114.                contains links to the 32-bit ordinals using the the DosXXX or 
  3115.                Dos32XXX names, and links to the 16-bit APIs using the Dos16XXX 
  3116.                names. 
  3117.  
  3118. Linking with these libraries allows the 16- and 32-bit versions of a given API 
  3119. to be called from the same EXE module.  The names used in the application must 
  3120. match these names by link time.  However, language preprocessors can be used to 
  3121. hide some of this from the application programmer. 
  3122.  
  3123. When you compile a program, use the appropriate compiler option to ensure that 
  3124. all variables defined in that compilation unit are guaranteed not to cross 64K 
  3125. boundaries. The option that directs your compiler to use 16-bit versions of the 
  3126. malloc family functions (calloc, malloc, realloc, and free) should be used as 
  3127. well. 
  3128.  
  3129. Note:  When you use the 16-bit enabling option, data items larger than 64K in 
  3130. size will be aligned on 64K boundaries, but will also cross 64K boundaries. 
  3131.  
  3132.  
  3133. ΓòÉΓòÉΓòÉ 3.3.1. Include File Architecture ΓòÉΓòÉΓòÉ
  3134.  
  3135. Only 16-bit APIs or only 32-bit APIs can be used in a single C module. To 
  3136. understand why, let's look at the OS/2 include file layout.  The OS2.H file 
  3137. includes OS2DEF.H before including the appropriate BASE and PM header files. 
  3138. OS2DEF.H contains typedefs and macros for most of the system related objects, 
  3139. structures, and data types used when accessing the APIs.  Programmers should 
  3140. use the same type names from the include files in both the 32-bit and 16-bit 
  3141. environment.  For example, when the code contains: 
  3142.  
  3143. PSZ     buffer = "hello";
  3144.  
  3145. in the 16-bit system, OS2DEF.H changes it to: 
  3146.  
  3147. char far   *buffer = "hello";
  3148.  
  3149. However in the 32-bit system the declaration will be converted to: 
  3150.  
  3151. char    *buffer = "hello";
  3152.  
  3153. because of the flat memory model. 
  3154.  
  3155. OS/2 2.0 provides support for the following 16-bit subsystems: 
  3156.  
  3157. o Vio (video functions) 
  3158. o Kbd (keyboard functions) 
  3159. o Mou (mouse functions) 
  3160. o Mon (monitor functions) 
  3161. If you want to use any other 16-bit API functions in your 32-bit code, you must 
  3162. provide the appropriate Header file(s).  The template for the OS2.H Include 
  3163. file is shown below. 
  3164.  
  3165. #define OS2_INCLUDED /* Indicating that this file has been included */
  3166.  
  3167. /* Common definitions */
  3168. #include <os2def.h>
  3169.  
  3170. /* OS/2 Base Include File */
  3171. #ifndef INCL_NOBASEAPI
  3172.    #include <bse.h>
  3173. #endif /* INCL_NOBASEAPI */
  3174.  
  3175. /* OS/2 Presentation Manager Include File */
  3176. #ifndef INCL_NOPMAPI
  3177.    #include <pm.h>
  3178. #endif /* INCL_NOPMAPI */
  3179.  
  3180.  
  3181. Template for the OS2.H Include File 
  3182.  
  3183.  
  3184. ΓòÉΓòÉΓòÉ 3.3.2. C Compiler Support ΓòÉΓòÉΓòÉ
  3185.  
  3186. The IBM C Set/2 compiler provides the capability of calling 16-bit API 
  3187. functions and using 16-bit far pointers (16:16) from flat model 32-bit 
  3188. applications.  This is done by providing three new keywords: _Seg16, _Far16, 
  3189. and _Pascal.  The _Seg16 keyword is used to declare 16:16 pointers, while the 
  3190. _Far16 and _Pascal keyword are used to declare 16-bit far function references 
  3191. and to generate the 16-bit far calling sequence in 32-bit code. 
  3192.  
  3193. The samples that follow were written using IBM C Set/2 keywords.  If you use a 
  3194. different compiler, use the keywords your compiler employs to achieve the same 
  3195. effect. 
  3196.  
  3197. To declare a pointer as 16:16, you would use the _Seg16 keyword: 
  3198.  
  3199. char * _Seg16 foo;
  3200.  
  3201. (Notice that _Seg16 comes after the *, not before.)  This declares foo to be a 
  3202. segmented pointer.  In any operations involving the pointer, the pointer is 
  3203. converted to a flat pointer prior to the operation and converted back into a 
  3204. segmented pointer (if necessary) after the operation is complete.  For example, 
  3205. for something like 
  3206.  
  3207. foo[0]='x';
  3208.  
  3209. the pointer foo is first converted to a flat pointer, then "x" is placed into 
  3210. the first element, rather than using the segmented pointer directly.  This 
  3211. means that a 16-bit routine can use the variable foo directly, since the value 
  3212. in the pointer already is stored in segmented form. 
  3213.  
  3214. Flat pointers also can use segmented pointers.  When a flat pointer is passed 
  3215. to a 16-bit routine, the pointer is automatically converted to 16:16 as it is 
  3216. passed. 
  3217.  
  3218. Note that pointers that are declared as _Seg16 are stored as 16:16 but 
  3219. de-referenced as 0:32.  Since all 16-bit objects are pseudo-tiled, this 
  3220. increases protection while sacrificing speed. 
  3221.  
  3222. Output parameters are converted.  If a 32-bit application calls a 16-bit API, 
  3223. and the API returns a 16:16 pointer, the output pointer is converted to the 
  3224. 0:32 format. 
  3225.  
  3226. Regardless of parameter conversions, the C compiler generates the 16-bit 
  3227. calling sequence when encountering a "_Far16 _Pascal" function call type.  The 
  3228. compiler calls a library function to switch to a 16-bit stack, push parameters 
  3229. and do parameter conversions, execute the 16-bit call, switch back to the 
  3230. 32-bit stack, and return to the 32-bit application. The following figure 
  3231. illustrates the stack frame generated for the VioXXX example. 
  3232.  
  3233. Stack frame for VioXXX Example 
  3234.  
  3235.  
  3236. ΓòÉΓòÉΓòÉ 3.3.3. Library Support ΓòÉΓòÉΓòÉ
  3237.  
  3238. C Set/2 has two sets of library files (.LIB):  16-bit and 32-bit versions.  The 
  3239. major difference between the two libraries is how the default name of an API 
  3240. function is handled, that is, what an API function reference is mapped to. 
  3241.  
  3242.  
  3243. ΓòÉΓòÉΓòÉ 3.4. Mixing 16-Bit and 32-Bit Code ΓòÉΓòÉΓòÉ
  3244.  
  3245. OS/2 2.0 supports 32-bit programs, 16-bit programs, and mixed programs 
  3246. (programs that contain both 16-bit and 32-bit code).  This section deals with 
  3247. mixed program development. 
  3248.  
  3249.  
  3250. ΓòÉΓòÉΓòÉ 3.4.1. Thunking ΓòÉΓòÉΓòÉ
  3251.  
  3252. All 32-bit OS/2 code can call 16-bit OS/2 code by conforming to the existing 
  3253. conventions in 16-bit OS/2's segmented dynamic link model. The only 16-bit 
  3254. modules a 32-bit application should use are the Vio, Kbd, Mou, or other 16-bit 
  3255. modules for which suppliers have not provided 32-bit support.  32-bit 
  3256. applications that use 16-bit functions might not run as fast as they would if 
  3257. they used 32-bit functions.  16-bit OS/2 code also can utilize 32-bit code by 
  3258. conforming to the 32-bit conventions.  Code that is used to glue 16- and 32-bit 
  3259. routines is commonly known as a thunk. A thunk can reside in an application or 
  3260. in a library module.  A 32-bit thunk binds 32-bit code to 16-bit code.  A 
  3261. 16-bit thunk binds 16-bit code to 32-bit code. The following figure illustrates 
  3262. how 16- and 32-bit applications and subsystems interact through the use of 
  3263. thunks. 
  3264.  
  3265. 16- to 32-Bit Application/Subsystem Interactions 
  3266.  
  3267. In OS/2 2.0, the operating system supplies an interface between 16-bit and 
  3268. 32-bit code, called a thunking layer.  The purpose of the thunking layer is to 
  3269. convert code and memory objects from 16-bit to 32-bit and back.  This 
  3270. conversion is transparent to the callee and caller. 
  3271.  
  3272. Thunk Models 
  3273.  
  3274. Most of the system-supplied thunks are of the 3216 variety. A 3216 thunk must 
  3275. perform the following functions when calling 16-bit code from 32-bit code. 
  3276.  
  3277.  1. Save the FLAT context. 
  3278.  
  3279.     The thunk should preserve the current FLAT context, which involves saving 
  3280.     the current DS and SS selectors.  The values in EBX, ESI, and EDI also need 
  3281.     to be preserved because the 16-bit PM conventions do not preserve them. 
  3282.     Also, the 32-bit calling convention saves EBX, ESI, and EDI. The 16-bit 
  3283.     calling convention only saves EDI and ESI, so EBX would be lost. 
  3284.  
  3285.     You should also save EBP, since the 16-bit function only uses BP. 
  3286.  
  3287.  2. Copy the parameters. 
  3288.  
  3289.     The parameters (or call frame) need to be reconstructed.  Parameters may 
  3290.     need to be aligned on the stack.  The flat memory environment usually 
  3291.     pushes 32-bit, DWORD-sized items.  The segmented memory environment uses 
  3292.     16-bit, WORD-sized items. 
  3293.  
  3294.     Copying parameters consists of: 
  3295.  
  3296.    o Checking for boundary crossings 
  3297.    o Converting pointers 
  3298.    o Pushing the parameters in the proper order 
  3299.  
  3300.  3. Convert the stack to 16:16. 
  3301.  
  3302.     The 16-bit function expects the stack to be addressable by SS:SP and BP. 
  3303.     The flat memory environment is passing in a ESP, EBP addressable stack. 
  3304.     The stack pointer, SS:SP is created by calling the API function, 
  3305.     DosFlatToSel on the current ESP. (See DosFlatToSel for more information on 
  3306.     DosFlatToSel.) 
  3307.  
  3308.  4. Call the 16-bit routine. 
  3309.  
  3310.     The thunk then executes a far 16:16 call to the target routine. 
  3311.  
  3312.  5. Restore the flat context. 
  3313.  
  3314.     The far 16:16 call will return to the thunk when the call is complete. The 
  3315.     thunk needs to restore all segment registers:  SS is retrieved, the DS 
  3316.     value is restored into both DS and ES, and ESP and EBP are both restored. 
  3317.     The saved registers EDI, ESI and EBX are also restored. 
  3318.  
  3319.     Note:  It is necessary to convert any parameters upon returning. 
  3320.  
  3321.  6. Return to caller. 
  3322.  
  3323. A 1632 thunk must perform the following functions when calling 32-bit code 
  3324. from 16-bit code. 
  3325.  
  3326.  1. Save the current context. 
  3327.  
  3328.     All the normal segment registers are about to be destroyed, so they should 
  3329.     be saved;  SS and DS should be saved, and ES if needed.  The extended 
  3330.     registers will be saved by the callee. 
  3331.  
  3332.  2. Copy the parameters. 
  3333.  
  3334.     Align parameters into DWORD sized parameters, if necessary. 
  3335.  
  3336.  3. Setup a flat context. 
  3337.  
  3338.     The 32-bit routine expects SS:ESP as the stack selector.  Use the 
  3339.     DosSelToFlat API function on SS:SP to create an ESP. (See DosSelToFlat for 
  3340.     more information on DosSelToFlat.) Then load the flat selectors into SS, 
  3341.     DS, and ES. 
  3342.  
  3343.  4. Call the 32-bit routine. 
  3344.  
  3345.     Perform a near (0:32) call to the 32-bit function. 
  3346.  
  3347.  5. Restore the saved context. 
  3348.  
  3349.     Restore SS:SP and DS. 
  3350.  
  3351.  6. Return to caller. 
  3352.  
  3353. One of the major goals of OS/2 2.0 is to provide compatibility between 16-bit 
  3354. and 32-bit versions.  Thunks provide this compatibility, by dealing with the 
  3355. following issues: 
  3356.  
  3357. o OS/2 Memory Layout 
  3358.  
  3359.   OS/2 2.0 uses a flat linear (0:32) addressing model. The 16-bit OS/2 code 
  3360.   uses a selector:offset (16:16) addressing model.  The thunk layer must 
  3361.   convert the addresses between the two models. 
  3362.  
  3363. o Different Parameter Sizes 
  3364.  
  3365.   The 32-bit version of the operating system uses 32-bit (LONG or DWORD) values 
  3366.   as the basic data type.  The 16-bit version uses a 16-bit (SHORT or WORD) 
  3367.   value as the basic data type.  The thunk layer must convert between WORD and 
  3368.   DWORD length data. 
  3369.  
  3370.   The 32-bit stack is DWORD based.  The 16-bit stack is WORD based.  The thunk 
  3371.   layer must make a new copy of the parameters on the stack and realign when 
  3372.   needed. 
  3373.  
  3374. o 64K Segment Boundary Problem 
  3375.  
  3376.   16-bit code can only address up to 64K in any one segment.  The only limit on 
  3377.   32-bit code is the maximum size of the linear address space (4GB).  This 
  3378.   creates a problem when a 32-bit data item is larger than 64K and is being 
  3379.   passed to 16-bit code.  The thunk layer must make the data item addressable 
  3380.   by the 16-bit routine. 
  3381.  
  3382. o Different Call Models 
  3383.  
  3384.   The 0:32 addressing model uses a near call for all functions.  The 16:16 
  3385.   model uses a far call for all functions.  A problem arises when a thread of 
  3386.   one model tries to call a procedure of the other model. The two models push 
  3387.   different return addresses on the stack.  The thunk layer must produce the 
  3388.   correct calling sequence. 
  3389.  
  3390.  
  3391. ΓòÉΓòÉΓòÉ 3.4.2. 32-Bit OS/2 Memory Layout ΓòÉΓòÉΓòÉ
  3392.  
  3393. This section briefly describes the memory layout for OS/2 2.0, and how the 
  3394. segmented memory environment is mapped to the flat memory environment. 
  3395.  
  3396.  
  3397. ΓòÉΓòÉΓòÉ 3.4.2.1. Flat Memory ΓòÉΓòÉΓòÉ
  3398.  
  3399. The 32-bit addressing of OS/2 2.0 is accomplished on the 386 by creating a very 
  3400. large segment (up to 4GB in size), and using all near addresses inside this 
  3401. large segment. A data and a code segment are mapped to this large address 
  3402. space, with their limits set to 4GB (0xfff...), as shown in the following 
  3403. figure. The selectors for this are allocated in the global descriptor table 
  3404. (GDT), and are called the flat selectors. 
  3405.  
  3406. Mapping the flat Address Space Using GDT Selectors 
  3407.  
  3408. All addresses in the flat memory model are 32-bit offsets into these two 
  3409. segments.  The base addresses of the two selectors are always zero, and 
  3410. therefore the flat offsets are the same as the linear addresses. 
  3411.  
  3412.  
  3413. ΓòÉΓòÉΓòÉ 3.4.2.2. Tiled Memory ΓòÉΓòÉΓòÉ
  3414.  
  3415. For OS/2 2.0 to be compatible with 16-bit applications, the 16-bit environment 
  3416. can be mapped to the 32-bit environment in such a way that addresses can be 
  3417. converted quickly between the two environments. 
  3418.  
  3419. This mapping is accomplished by a technique called tiling. A tiled local 
  3420. descriptor table (LDT) contains up to 8192 descriptors, where the segment base 
  3421. address in each descriptor is a multiple of 64KB.  In this manner, each 
  3422. descriptor points to a 64KB region of memory.  Contiguous descriptors map into 
  3423. a contiguous linear address space.  Because the LDT only holds 8192 selectors, 
  3424. the maximum address allowed in the tiled memory region is 512MB. The following 
  3425. figure shows the way in which memory addresses within the tiled LTD are mapped 
  3426. into the process address space. This tiled region of memory is called the 
  3427. compatibility region. 
  3428.  
  3429. 16-Bit Address Space Mapped to the Flat Address Space 
  3430.  
  3431. The addresses within the process address space can be referenced by 
  3432. applications or modules using 16:16 addressing, in a manner similar to previous 
  3433. versions of the operating system. However, the same physical memory locations 
  3434. can also be accessed by 32-bit applications and modules using the 0:32 
  3435. addressing method.  Both the LDT entries used for 16:16 memory addressing and 
  3436. the page table entries used for 0:32 memory addressing can translate to the 
  3437. same memory locations.  This enables 32-bit applications to make use of 16-bit 
  3438. modules and resources, and allows 32-bit and 16-bit applications to coexist and 
  3439. communicate with one another. 
  3440.  
  3441. LDTs are managed in a different way from previous versions of the operating 
  3442. system.  Each LDT is allocated a sparse memory object until descriptors are 
  3443. inserted upon loading an application.  Descriptors for shared memory objects 
  3444. are inserted downwards starting at the top of the LDT, whereas private memory 
  3445. descriptors are inserted upwards starting at the bottom of the LDT.  This 
  3446. reflects the management of the linear address space by the operating system. 
  3447. Therefore, the minimum LDT size is 8KB, using one page for the shared 
  3448. descriptors and one page for the private descriptors.  Note that each code or 
  3449. data selector reserves a full 64KB of linear address space. 
  3450.  
  3451. This is equivalent to the implementation used in the previous versions of the 
  3452. operating system.  It must be noted, however, that a memory object greater than 
  3453. 64KB require special handling when used. 
  3454.  
  3455. The following memory objects use LDT descriptors: 
  3456.  
  3457. o 16-bit EXE files 
  3458. o 16-bit DLL files 
  3459. o DosAllocSeg() calls 
  3460. o DosAllocMem() calls with tiling 
  3461. o 32-bit EXE files with tiling 
  3462. o 32-bit DLL files with tiling 
  3463.  
  3464. Important notes about tiled memory: 
  3465.  
  3466. o Only LDT selectors are tiled.  This means that only selectors allocated from 
  3467.   the LDT can be converted. 
  3468.  
  3469. A memory object allocated in the compatibility region has both a 16:16 address 
  3470. and a 0:32 address, allowing access by applications using either addressing 
  3471. method.  All 32-bit executable modules can therefore create 16:16 aliases for 
  3472. memory objects in the compatibility region and conversely, 16-bit modules can 
  3473. create 0:32-bit aliases.  The two types of addresses are related by the 
  3474. following API functions: 
  3475.  
  3476. o DosSelToFlat 
  3477. o DosFlatToSel 
  3478.  
  3479.  
  3480. ΓòÉΓòÉΓòÉ 3.4.2.2.1. DosSelToFlat ΓòÉΓòÉΓòÉ
  3481.  
  3482. The DosSelToFlat API function converts a 16:16 address to a 0:32 address.  This 
  3483. function is described as follows: 
  3484.  
  3485. PVOID DosSelToFlat (ULONG ulSelector);
  3486.  
  3487. Using DosSelToFlat 
  3488.  
  3489. This function takes a 32-bit selector value (ulSelector) and returns a pointer 
  3490. to the 32-bit flat address. 
  3491.  
  3492.  
  3493. ΓòÉΓòÉΓòÉ 3.4.2.2.2. DosFlatToSel ΓòÉΓòÉΓòÉ
  3494.  
  3495. The DosFlatToSel API function converts a 0:32 address to a 16:16 address.  This 
  3496. function is described as follows: 
  3497.  
  3498. ULONG DosFlatToSel (PVOID pFlatAddress);
  3499.  
  3500. Using DosFlatToSel 
  3501.  
  3502. This function takes a pointer to a 32-bit flat address (pFlatAddress) and 
  3503. returns a 32-bit selector value. 
  3504.  
  3505.  
  3506. ΓòÉΓòÉΓòÉ 3.4.3. Different Parameter Sizes ΓòÉΓòÉΓòÉ
  3507.  
  3508. The most significant problem with different parameter sizes is the packing of 
  3509. structures.  If there are two different structures for 16 and 32 bit with the 
  3510. same name and it is used in the call, then the thunk has to take this into 
  3511. account when passing the information. All the problems in this area can be 
  3512. eliminated if any structure that you define in 32-bit code is made up of only 
  3513. DWORDS. 
  3514.  
  3515.  
  3516. ΓòÉΓòÉΓòÉ 3.4.4. 64K Segment Boundary Problems ΓòÉΓòÉΓòÉ
  3517.  
  3518. The mixed model programmer must be aware of potential problems when converting 
  3519. addresses between the two addressing models. 
  3520.  
  3521. Consider the following scenario: 
  3522.  
  3523.  1. A 32-bit program passing a pointer to a 16-bit routine. 
  3524.  
  3525.  2. The object referenced by this pointer crosses a 64K tile boundary. 
  3526.  
  3527.  3. The pointer is converted using DosFlatToSel. 
  3528.  
  3529. When the 16-bit routine tries to reference the data object, it will be unable 
  3530. to access the part of the object past the 64K tile boundary, as illustrated in 
  3531. the following figure. 
  3532.  
  3533. Data Item Spans 64K Tile Boundary 
  3534.  
  3535. In the previous figure, the data object starts at 32-bit address 0x1ef00, and 
  3536. ends at 0x24100. When the starting address is converted, it produces the 16&16 
  3537. address 0f:ef00. However, the length of the data item is 0x5200.  The 16:16 
  3538. routine will be unable to address the end of the object, because its offset is 
  3539. greater than 64K, which is larger than the 16-bit segment limit. 
  3540.  
  3541. To make this data item addressable, the caller will have to copy it to another 
  3542. location in memory that will not cross a boundary. 
  3543.  
  3544.  
  3545. ΓòÉΓòÉΓòÉ 3.4.5. Different Call Models ΓòÉΓòÉΓòÉ
  3546.  
  3547. In a 16-bit far call, CS and IP are pushed when the call is made.  In a 32-bit 
  3548. segment call, CS and EIP are pushed.  To assure that the correct return address 
  3549. is on the stack, the 3216 thunk jumps to a 16-bit segment before making a 
  3550. 16:16 call.  When the call returns, the thunk makes a far jump to 32-bit code 
  3551. that continues the processing.  If the call had been made from the 0:32 
  3552. segment, the stack would not have had a valid return address on it, since EIP 
  3553. would have been pushed.  For 16:160:32 thunks, in order to get the correct 
  3554. return address, the thunk jumps to 32-bit code to make the call. 
  3555.  
  3556. Another consideration in the call model is the calling convention. A 16-bit 
  3557. application might very well be using the Pascal calling convention with the 
  3558. 32-bit code using the C calling convention.  It is obvious that the parameters 
  3559. need to be pushed on the stack to conform to the convention that is used. 
  3560.  
  3561.  
  3562. ΓòÉΓòÉΓòÉ 3.4.6. Calling 16-Bit Code from 32-Bit Code ΓòÉΓòÉΓòÉ
  3563.  
  3564. This section describes some of the conventions used for calling 16-bit code 
  3565. from 32-bit code. 
  3566.  
  3567. The samples that follow were written using IBM C Set/2 keywords.  If you use a 
  3568. different compiler, use the keywords your compiler employs to achieve the same 
  3569. effect. 
  3570.  
  3571. IBM C Set/2 provides three linkage conventions for calling 16-bit code.  These 
  3572. are: 
  3573.  
  3574. o Far16 cdecl 
  3575. o Far16 fastcall 
  3576. o Far16 pascal. 
  3577.  
  3578. For example, a function Func can be declared as a 16-bit function using the 
  3579. Far16 pascal linking convention. 
  3580.  
  3581. long _Far16 _Pascal Func (short, char *);
  3582.  
  3583. Using _Far16 _Pascal to Declare a 16-Bit Function 
  3584.  
  3585. The _Seg16 type qualifier is used to declare 16-bit pointers.  For example: 
  3586.  
  3587. char * _Seg16 p16;
  3588.  
  3589. Using _Seg16 to Declare 16-Bit Pointers 
  3590.  
  3591. declares p16 as a segmented pointer that can be used directly by a 16-bit 
  3592. application. 
  3593.  
  3594. The #pragma seg16 directive is used to ensure that shared data items do not 
  3595. cross 64K boundaries. The #pragma seg16 directive can be used directly with the 
  3596. data item or through a typedef. 
  3597.  
  3598. The following code fragment shows both ways of using this directive: 
  3599.  
  3600. struct family {
  3601.    long           john;
  3602.    double         carolynn;
  3603.    char * _Seg16  geoff;
  3604.    long           colleen;
  3605. };
  3606.  
  3607. #pragma seg16 (cat)
  3608. struct family cat;                /* Cat is qualified directly */
  3609.  
  3610. typedef struct family tom;
  3611. #pragma seg16 (tom)
  3612. tom edna;                         /* Edna is qualified using a typedef */
  3613.  
  3614.  
  3615.  
  3616. Using the #pragma seg16 Directive 
  3617.  
  3618.  
  3619. ΓòÉΓòÉΓòÉ 3.4.6.1. Using the _Seg16 and _Far16 _Pascal Keywords ΓòÉΓòÉΓòÉ
  3620.  
  3621. The keywords, _Seg16 and _Far16 _Pascal, are used to call 16-bit routines from 
  3622. 32-bit modules. These keywords are: 
  3623.  
  3624. o Available only in modules compiled as 32-bit 
  3625. o Used to convert pointers into their selector:offset representation 
  3626. o Used to modify function prototypes. 
  3627.  
  3628. char * _Seg16 Ptr;
  3629. char *Ptr32;
  3630. int main(void)
  3631. {
  3632.         Ptr = "A B C D";
  3633.         Ptr32 = "A B C D";
  3634.         return 0;
  3635. }
  3636.  
  3637. Using _Seg16
  3638.  
  3639. In the above figure, Ptr gets a 16:16 address to the string, while Ptr32 gets a 
  3640. 32-bit flat address to the string. When a 32-bit module dereferences a _Seg16 
  3641. pointer, an inline conversion is generated before the memory is accessed. 
  3642.  
  3643. When _Far16 _Pascal is used on a function prototype, IBM C Set/2 will produce a 
  3644. very simple thunk to get you to the 16-bit routine. 
  3645.  
  3646.         extern short _Far16 _Pascal m16();
  3647.  
  3648. The following figure illustrates that _Far16 _Pascal is valid only inside 
  3649. 32-bit modules. 
  3650.  
  3651. char * _Seg16 pchPtr;
  3652.  
  3653. extern short _Far16 _Pascal DosWrite(short,
  3654.                                      char *,
  3655.                                      short,
  3656.                                      short *);
  3657.  
  3658. int main(void)
  3659. {       short cbWrite;
  3660.  
  3661.         pchPtr = "Hello World\n";
  3662.  
  3663.         /* If using the DosWrite function, you must link with  */
  3664.         /* OS2286.LIB, or else use the Dos16Write function     */
  3665.  
  3666.         DosWrite(0,pchPtr,strlen(pchPtr),&cbWrite);
  3667.  
  3668.         return 0;
  3669. }
  3670.  
  3671. Using _Far16 in a 32-Bit Module 
  3672.  
  3673.  
  3674. ΓòÉΓòÉΓòÉ 3.4.6.2. Formal Parameters ΓòÉΓòÉΓòÉ
  3675.  
  3676. When calling a _Far16 _Pascal function, the IBM C Set/2 compiler will use WORD 
  3677. size parameters, instead of the default DWORD size (if the function prototype 
  3678. calls for WORD parameters). 
  3679.  
  3680. extern long DosBeep(long,long);
  3681. extern short _Far16 _Pascal Dos16Beep(short,short);
  3682. int main(void)
  3683. {
  3684.         Dos16Beep(400,50);      // 16-bit DosBeep
  3685.         DosBeep(300,100);
  3686.         return 0;
  3687. }
  3688.  
  3689. Passing Different Size Parameters 
  3690.  
  3691. In the figure above, 16-bit 400 and a 16-bit 50 will be pushed on the stack. In 
  3692. contrast, the 32-bit call to to DosBeep will push a 32-bit 300 and 100. 
  3693.  
  3694. As mentioned previously there are two major problems to handle when passing 
  3695. data to a 16-bit module:  objects crossing 64K segment boundaries and the WORD 
  3696. vs DWORD alignment in structures. 
  3697.  
  3698.  
  3699. ΓòÉΓòÉΓòÉ 3.4.6.2.1. The 64K Segment Boundary Problem ΓòÉΓòÉΓòÉ
  3700.  
  3701. Using the IBM C Set/2 compiler, you can alleviate the 64K segment boundary 
  3702. problem when the data object is smaller than 64KB by using the /Gt+ switch to 
  3703. control alignment. 
  3704.  
  3705. o No statically allocated data will cross a 64K boundary when the /Gt+ switch 
  3706.   is specified.  This means the compiler will never declare global or static 
  3707.   variables that cross 64K boundaries. 
  3708.  
  3709. o Local variables in a function that calls a 16-bit function will not cross a 
  3710.   64K boundary.  Any memory that you allocate will not cross a boundary when 
  3711.   the /Gt+ switch is specified. 
  3712.  
  3713. o No system allocated memory will cross a boundary. Every data object that you 
  3714.   allocate using DosAllocMem will always start on a 64K boundary.  If the item 
  3715.   is smaller than 64K, then the item will never cross a boundary, but only if 
  3716.   the OBJ_TILE flag is given. 
  3717.  
  3718. However, if you allocate a very large buffer, and pass a pointer into the 
  3719. buffer that is near a 64K boundary, the 16-bit routine will be unable to fully 
  3720. address the object. 
  3721.  
  3722. Function prototypes should be declared as follows: 
  3723.  
  3724. extern short _Far16 _Pascal m16(short, char *);
  3725.  
  3726. noting the following: 
  3727.  
  3728. o Any pointer parameters do not have to be explicitly declared as _Far16 
  3729.   _Pascal.  The compiler will assume that pointers are supposed to be _Far16 
  3730.   _Pascal. 
  3731.  
  3732. o If you pass a _Seg16 pointer to a 32-bit routine, you should be sure that a 
  3733.   function prototype for the 32-bit routine exists.  Also, make sure that the 
  3734.   parameter is declared as a pointer.  If there is no prototype, then you 
  3735.   should explicitly cast the pointer to be a normal 32-bit pointer.  For 
  3736.   example: printf("%s",(char *) pFar16Ptr); 
  3737.  
  3738.  
  3739. ΓòÉΓòÉΓòÉ 3.4.6.2.2. Structure Alignment ΓòÉΓòÉΓòÉ
  3740.  
  3741. There are structures in the system, and especially in PM, that have different 
  3742. packing between their 16- and 32-bit representations. 
  3743.  
  3744. DWORD alignment in C language means items that are DWORD in length, such as 
  3745. pointers, will always be aligned on 4 byte boundaries.  WORD alignment means 
  3746. that items that are WORD size or greater will be aligned on 2 byte boundaries. 
  3747. DWORD alignment does not mean that all structure members are DWORD aligned. 
  3748. Refer to the following figure for an example. 
  3749.  
  3750.                         Offsets for
  3751.  
  3752.                         WORD    DWORD
  3753. typedef struct _K {
  3754.         char c;         0       0
  3755.         char c2;        1       1
  3756.         long b;         2       4
  3757.         short a;        6       8
  3758.         short d;        8       10
  3759.         } K;
  3760.  
  3761.  
  3762. Structure Alignment 
  3763.  
  3764. Notice that c and c2 are byte-sized items and, therefore, do not qualify for 
  3765. alignment.  Notice that b is aligned on a WORD boundary for WORD alignment, and 
  3766. DWORD boundary for DWORD alignment.  Elements a and d are WORD aligned in both 
  3767. alignment types. 
  3768.  
  3769. The following table categorizes alignment by data size. 
  3770.  
  3771. WORD/DWORD Alignment 
  3772.  
  3773. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3774. ΓöéAlignment               ΓöéBYTE        ΓöéWORD Data   ΓöéDWORD Data  Γöé
  3775. Γöé                        Γöé            ΓöéSize        ΓöéSize        Γöé
  3776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3777. ΓöéWORD                    ΓöéBYTE        ΓöéWORD        ΓöéWORD        Γöé
  3778. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3779. ΓöéDWORD                   ΓöéBYTE        ΓöéWORD        ΓöéDWORD       Γöé
  3780. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3781.  
  3782. Problems with alignment result when data is shared between 32-bit and 16-bit 
  3783. modules, or when calling 16-bit subsystems, such as Vio or Kbd. For example, 
  3784. consider the code in the following figure. 
  3785.  
  3786. typedef struct _KBDKEYINFO {    // Offsets
  3787.     UCHAR  chChar;              // 0
  3788.     UCHAR  chScan;              // 1
  3789.     UCHAR  fbStatus;            // 2
  3790.     UCHAR  bNlsShift;           // 3
  3791.     USHORT fsState;             // 4
  3792.     ULONG  time;                // 6    (32-bit offset is 8)
  3793. } KBDKEYINFO;
  3794.  
  3795. extern USHORT _Far16 _Pascal KBD16PEEK(KBDKEYINFO _Far16 *,USHORT);
  3796.  
  3797. main()
  3798. {
  3799.         KBDKEYINFO kbciKeyInfo;
  3800.  
  3801.         KBD16PEEK(&kbciKeyInfo, 0);
  3802. }
  3803.  
  3804. Example of a Packing Problem 
  3805.  
  3806. In the figure above, the last element of the KBDKEYINFO structure (time) has a 
  3807. different offset between the 32-bit program and the 16-bit API. 
  3808.  
  3809. Several actions can be taken to solve this problem: 
  3810.  
  3811. o Change the packing of one of the modules using the IBM C Set/2 switch, /Sp. 
  3812.  
  3813.   The compiler switch /Sp resets the default packing for the C compiler. The 
  3814.   default packing for 16-bit programs is WORD alignment, and the default 
  3815.   packing for 32-bit programs is DWORD alignment.  Using this switch may cause 
  3816.   problems if the module is going to call other systems. For example, using 
  3817.   /Sp2 will fix the call to Kbd, but will cause problems with calls to true 
  3818.   32-bit subsystems. 
  3819.  
  3820. o Change the structure definition so that alignment does not affect the offsets 
  3821.   of any elements.  The easiest way to do this is to sort the elements by size 
  3822.   so that DWORDs are first, followed by WORDS and then BYTES. 
  3823.  
  3824.   This is the suggested solution if you have control over the data structures 
  3825.   definition.  However, here the structure is defined by the system. 
  3826.  
  3827. o Use a #pragma to change the packing of a particular item, as shown in the 
  3828.   following figure. 
  3829.  
  3830.   In this situation, using the #pragma is the best choice.  It has no impact on 
  3831.   other data structures, and can be used to target specific structures. 
  3832.  
  3833. #pragma pack(2)
  3834. typedef struct _KBDKEYINFO {    // Offsets
  3835.     UCHAR  chChar;              // 0
  3836.     UCHAR  chScan;              // 1
  3837.     UCHAR  fbStatus;            // 2
  3838.     UCHAR  bNlsShift;           // 3
  3839.     USHORT fsState;             // 4
  3840.     ULONG  time;                // 6    (32-bit offset is 8)
  3841. } KBDKEYINFO;
  3842.  
  3843. #pragma pack()    // Resets packing to the default value
  3844.  
  3845. extern USHORT _Far16 _Pascal KBD16PEEK(KBDKEYINFO _Far16 *,USHORT);
  3846.  ...
  3847.  
  3848.  
  3849. Another Packing Problem 
  3850.  
  3851. Other alignment problems may develop in applications as well.  Consider the 
  3852. following code fragment. 
  3853.  
  3854.  
  3855.         typedef struct _LineBuf {
  3856.                 USHORT Row;
  3857.                 USHORT Col;
  3858.                 char *Text;
  3859.                 USHORT Attr;
  3860.                 } LineBuf;
  3861.  
  3862.         LineBuf MainBuf[12];
  3863.  
  3864. Encountering Alignment Problems 
  3865.  
  3866. Notice that the alignment of LineBuf is the same between 16-bit and 32-bit 
  3867. modules. However, the alignment is different when the structure element is in 
  3868. an array, as illustrated in the following figure. 
  3869.  
  3870. An Array Structure Element 
  3871.  
  3872. For the element Text to always be DWORD aligned, each instance of the structure 
  3873. must begin on a DWORD boundary. 
  3874.  
  3875. When you have an array of these structures, the 32-bit compiler must pad out 
  3876. the array so that the alignment works out correctly, as illustrated in the 
  3877. following figure. 
  3878.  
  3879. Aligning an Array of Structures 
  3880.  
  3881. However, a 16-bit compiler does not do this for DWORD values.  Hence the 
  3882. difference in the arrays. In general, if the structure has DWORD length items 
  3883. and the length of the structure is not a multiple of 4, then the structure will 
  3884. be padded if used in an array.  The packing will need to be changed for 
  3885. addressing to work correctly.  With the IBM C Set/2 compiler, use the #pragma 
  3886. pack(2) statement. 
  3887.  
  3888.  
  3889. ΓòÉΓòÉΓòÉ 3.4.6.3. Examples of using _Far16 _Pascal and _Seg16 ΓòÉΓòÉΓòÉ
  3890.  
  3891. Here are several example programs that make use of the _Far16 _Pascal and 
  3892. _Seg16 Keywords. 
  3893.  
  3894. /*
  3895.  *  32-16 example 1.  Compile using the /Ss option.
  3896.  */
  3897.  
  3898. #include <os2.h>
  3899. #include <stdio.h>
  3900.  
  3901. extern USHORT _Far16 _Pascal DOS16READ(unsigned USHORT,char *,
  3902.                             unsigned USHORT,unsigned USHORT *);
  3903.  
  3904. extern USHORT _Far16 _Pascal DOS16WRITE(unsigned USHORT,char *,
  3905.                             unsigned USHORT,unsigned USHORT *);
  3906.  
  3907. char *String="Enter Your Name: ";
  3908. char * _Seg16 String16;
  3909.  
  3910. int main(void)
  3911. {
  3912.    USHORT ret16,cbRead16;
  3913.    ULONG ret,cbRead;
  3914.    char buf[128];
  3915.  
  3916.    String16 = String;
  3917.  
  3918.    ret = DosWrite(0,String,strlen(String),&cbRead); // 32-bit call
  3919.  
  3920.    ret16 = DOS16READ(0,buf,127,&cbRead16);   // 16-bit call
  3921.  
  3922.    ret16 = DOS16WRITE(0,buf,cbRead16,&cbRead16); // 16-bit call
  3923.  
  3924.    return 0;
  3925. }
  3926.  
  3927. Using the _Far16 _Pascal and _Seg16 Keywords 
  3928.  
  3929. This example program has several notable features: 
  3930.  
  3931. o Function prototypes 
  3932.  
  3933.   At the start of the file, the standard <OS2.H> file is included.  This will 
  3934.   give the function prototypes, typedefs, and structure definitions for the 
  3935.   standard 32-bit APIs.  You must create your own 16-bit function prototypes 
  3936.   for all 16-bit functions you plan to use. 
  3937.  
  3938. o Names of 16-bit routines 
  3939.  
  3940.   Note the use of DOS16 as the prefix for the 16-bit calls.  The library files 
  3941.   for OS/2 2.0 have been expanded to include these new names.  They are 
  3942.   intended to remove conflicts between names.  In the example program above, 
  3943.   there are calls to both the 16- and 32-bit versions of DosWrite. The only way 
  3944.   to differentiate between the 16- and 32-bit versions of the API functions is 
  3945.   by appending the 16 to the component name. 
  3946.  
  3947. The following example has a slightly more complicated structure. 
  3948.  
  3949. /*
  3950.  * 32-16 example 2.  Compile using the /Ss option.
  3951.  */
  3952. #include <os2.h>
  3953. #include <stdio.h>
  3954.  
  3955. #pragma pack(2)
  3956.  
  3957. typedef struct _KBDKEYINFO {    // Offsets
  3958.     UCHAR  chChar;              // 0
  3959.     UCHAR  chScan;              // 1
  3960.     UCHAR  fbStatus;            // 2
  3961.     UCHAR  bNlsShift;           // 3
  3962.     USHORT fsState;             // 4
  3963.     ULONG  time;                // 6    (32-bit offset is 8)
  3964. } KBDKEYINFO;
  3965.  
  3966. #pragma pack()
  3967.  
  3968. extern USHORT _Far16 _Pascal KBD16PEEK(KBDKEYINFO *,USHORT);
  3969.  
  3970. int main(void)
  3971. {
  3972.     KBDKEYINFO kbciKeyInfo;
  3973.  
  3974.     KBD16PEEK(&kbciKeyInfo, 0);
  3975.  
  3976.     return 0;
  3977.  
  3978. }
  3979.  
  3980. Another Example of Using _Far16 _Pascal and _Seg16
  3981.  
  3982. In this example, the packing #pragma is used.  As previously discussed, this 
  3983. will force the IBM C Set/2 compiler to use WORD alignment for any structures 
  3984. defined in this range. 
  3985.  
  3986.  
  3987. Using the Packing Pragma Convention
  3988.  
  3989. /*
  3990.  * 32-16 example 3.  Compile using the /Ss option.
  3991.  */
  3992.  
  3993. #include <os2.h>
  3994. #include <stdio.h>
  3995.  
  3996. #pragma pack(2)
  3997. typedef struct _VIOMODEINFO {    /* viomi */
  3998.     USHORT cb;
  3999.     UCHAR  fbType;
  4000.     UCHAR  color;
  4001.     USHORT col;
  4002.     USHORT row;
  4003.     USHORT hres;
  4004.     USHORT vres;
  4005.     UCHAR  fmt_ID;
  4006.     UCHAR  attrib;
  4007.     ULONG  buf_addr;
  4008.     ULONG  buf_length;
  4009.     ULONG  full_length;
  4010.     ULONG  partial_length;
  4011.     char * _Seg16 ext_data_addr;
  4012. } VIOMODEINFO;
  4013. #pragma pack()
  4014.  
  4015. #define VGMT_GRAPHICS              0x02
  4016.  
  4017. USHORT _Far16 _Pascal Vio16GetMode (VIOMODEINFO *, USHORT);
  4018.  
  4019. int main(void)
  4020. {
  4021.     VIOMODEINFO viomi;
  4022.     viomi.cb = sizeof(viomi);
  4023.  
  4024.     Vio16GetMode(&viomi, 0);
  4025.  
  4026.     printf("The current screen is %hd by %hd",viomi.col,viomi.row);
  4027.  
  4028.     return 0;
  4029. }
  4030.  
  4031. In this figure, note "char * _Seg16 ext_data_addr" in the structure definition. 
  4032. This structure is being passed into a 16-bit API.  Therefore, any pointer that 
  4033. is passed in must be declared as _Seg16.  This will insure that the pointer is 
  4034. stored in a selector:offset format, and will be usable by the target API. 
  4035.  
  4036.  
  4037. ΓòÉΓòÉΓòÉ 3.4.7. Function Calls to 16-Bit Modules ΓòÉΓòÉΓòÉ
  4038.  
  4039. Thunking considerations affect the way in which a 16-bit function must be 
  4040. declared within the 32-bit module, and the way in which parameters passed to 
  4041. the 16-bit function are defined.  When using IBM C Set/2, such functions and 
  4042. parameters must be declared using the #pragma linkage directive and the _Far16 
  4043. _Pascal keyword, as shown in the following figure. 
  4044.  
  4045. #pragma stack16(8192)
  4046.  
  4047. USHORT _Far16 _Pascal MyFunction(USHORT FirstNum, HWND _Seg16 hWnd);
  4048.  
  4049.  
  4050. Declaring a 16-Bit Function in 32-Bit Code 
  4051.  
  4052. Note the use of the #pragma stack16 directive to set the stack size for all 
  4053. 16-bit function calls made from the 32-bit module. 
  4054.  
  4055. Declaring a 16-bit function in this manner will cause the operating system to 
  4056. automatically perform thunking for all "value" parameters (that is, those other 
  4057. than pointers).  Pointers passed as parameters must be explicitly defined using 
  4058. the _Seg16 keyword, as shown in the above figure. 
  4059.  
  4060.  
  4061. ΓòÉΓòÉΓòÉ 3.4.7.1. Using 16-Bit Window Procedures ΓòÉΓòÉΓòÉ
  4062.  
  4063. A 32-bit application can access window procedures which reside in 16-bit 
  4064. modules, either statically linked or as DLLs.  However, the differences between 
  4065. addressing methods requires some consideration on the part of the developer, 
  4066. since both the window handles and any pointers passed as message parameters 
  4067. will differ in their representation. 
  4068.  
  4069.  
  4070. ΓòÉΓòÉΓòÉ 3.4.7.2. Creating a Window ΓòÉΓòÉΓòÉ
  4071.  
  4072. When a 32-bit application module creates a window, and the window procedure for 
  4073. that window resides in a 16-bit module (either statically linked or in a DLL), 
  4074. the calling routine must explicitly declare the 16-bit nature of the window 
  4075. procedure's entry point when registering the window class.  This can become 
  4076. rather complex, since it involves invoking a 32-bit entry point from a 32-bit 
  4077. module, but passing a 16-bit entry point as a parameter. 
  4078.  
  4079. A simpler solution is to build a registration routine within the 16-bit module, 
  4080. which registers the window class and creates the window.  The 32-bit module 
  4081. then need only invoke this routine, and allow for the resulting 16-bit window 
  4082. handle.  This technique has the added advantage that PM records the fact that 
  4083. the window was registered from a 16-bit module, and will automatically perform 
  4084. thunking for system-defined message classes. The technique is illustrated in 
  4085. the following figure. 
  4086.  
  4087. Since the 16-bit module would typically be a DLL, the registration routine is 
  4088. declared in the 16-bit module as an exportable entry point using the EXPENTRY 
  4089. keyword. 
  4090.  
  4091. The 32-bit module declares the registration routine MakeMyWindow() as a 16-bit 
  4092. function using the Far16 _Pascal keyword. Since the EXPENTRY keyword forces use 
  4093. of the Pascal calling convention, the directive also specifies this calling 
  4094. convention.  Note that if the registration routine and the window procedure 
  4095. were to reside in a DLL, this declaration would typically take place within a 
  4096. header file provided by the developer of the DLL. 
  4097.  
  4098. The 32-bit module invokes the registration routine which registers the window 
  4099. class and creates the window.  The registration routine then returns the window 
  4100. handle to the 32-bit module, which stores it in 16:16 format.  Note that the 
  4101. registration routine in the 16-bit module is not aware that it is being called 
  4102. from a 32-bit module. 
  4103.  
  4104. 32-bit Module
  4105.  
  4106. #pragma stack16(8192)
  4107.  
  4108. HWND EXPENTRY16 MakeMyWindow(void);        /* 16-bit function prototype  */
  4109.  
  4110. HWND _Seg16 hWindow;                       /* 16:16 window handle  */
  4111.   :
  4112.   :
  4113. hWindow = MakeMyWindow();                  /* Call registration routine  */
  4114.  
  4115. 16-bit Module
  4116.  
  4117. HWND EXPENTRY MakeMyWindow(void)           /* Registration routine       */
  4118. {
  4119.      HWND hCurrWindow;                     /* 16:16 window handle  */
  4120.  
  4121.      WinRegisterClass(...);                /* Register window class      */
  4122.      hCurrWindow = WinCreateWindow(...);   /* Create window              */
  4123.  
  4124.      return(hCurrWindow);            /* Return 16:16 window handle */
  4125. }
  4126.  
  4127. Creating a 16-Bit Window From Within a 32-Bit Module 
  4128.  
  4129. This approach allows the same DLL to be accessed by both 16-bit and 32-bit 
  4130. applications concurrently.  The developer of the DLL simply provides two 
  4131. separate header files containing declarations of the DLL's entry points, in the 
  4132. appropriate format for each programming environment. 
  4133.  
  4134.  
  4135. ΓòÉΓòÉΓòÉ 3.4.7.3. Passing Messages to 16-Bit Windows ΓòÉΓòÉΓòÉ
  4136.  
  4137. Passing data between 16-bit and 32-bit window procedures via message parameters 
  4138. also requires consideration of the internal representations of the data types 
  4139. passed within the parameter.  For system-defined message classes, this is 
  4140. handled automatically by OS/2 2.0, but for application-defined message classes 
  4141. the conversion between addressing methods must be handled by the application, 
  4142. since the operating system has no way of determining the intended contents of 
  4143. each parameter. 
  4144.  
  4145. Simple value parameters (such as integers or characters) can be passed without 
  4146. the need for translation. Message parameters should be constructed using the 
  4147. standard PM macros. 
  4148.  
  4149. When a pointer or handle is passed in a message parameter to a 16-bit window 
  4150. procedure, the pointer or handle must be translated to the 16:16 addressing 
  4151. method by the application.  Since the 16-bit module is unlikely to have been 
  4152. written with code to achieve this conversion, it is the responsibility of the 
  4153. 32-bit module. 
  4154.  
  4155. Conversion can be achieved using the _Seg16 keyword to explicitly define a 
  4156. 16:16 pointer or handle, which is then placed in a message parameter using the 
  4157. MPFROMP macro. This is illustrated in the following figure. This example shows 
  4158. the 32-bit code necessary to define and initialize a 16:16 pointer to be passed 
  4159. to a 16-bit window procedure. 
  4160.  
  4161. typedef struct mystruct {                  /* Define data structure      */
  4162.                         CHAR * _Seg16 Name;
  4163.                         ULONG         ulA;
  4164.                         ULONG         ulB;
  4165.                         USHORT        usC;
  4166.                         } MYSTRUCT;
  4167.  
  4168. #pragma seg16(MYSTRUCT)                    /* Define pragma directive    */
  4169.  
  4170. MYSTRUCT * _Seg16 MyStruct;                /* 16:16 pointer        */
  4171.  
  4172. BOOL            bSuccess;                  /* Success flag               */
  4173.  
  4174. MPARAM          lParam1;                   /* Message parameter          */
  4175.  
  4176. bSuccess = DosAllocMem(&MyStruct,      /* Allocate data structure    */
  4177.                        4096,               /* Size of data structure     */
  4178.                        PAG_READ  |         /* Allow read access          */
  4179.                        PAG_WRITE |         /* Allow write access         */
  4180.                        PAG_COMMIT);        /* Commit storage immediately */
  4181.  
  4182. <Initialize structure if required>
  4183.  
  4184. lParam1 = MPFROMP(MyStruct);               /* Set message parameter      */
  4185.  
  4186. Passing a 16:16 Pointer as a Message Parameter 
  4187.  
  4188. The resulting message parameter can then be passed to a window in a 16-bit 
  4189. module using the normal WinPostMsg() or WinSendMsg() functions, using a 16:16 
  4190. window handle obtained in the manner shown.  Note that the data structure 
  4191. referenced by the pointer cannot be greater than 64KB in size, and must not 
  4192. cross a segment boundary.  This is ensured in the above figure by using the 
  4193. #pragma seg16 directive, since a structure defined using this pragma will 
  4194. automatically be aligned on a segment boundary. 
  4195.  
  4196.  
  4197. ΓòÉΓòÉΓòÉ 3.4.7.4. Passing Messages to 32-Bit Windows ΓòÉΓòÉΓòÉ
  4198.  
  4199. The technique described above handles messages passed to a window in a 16-bit 
  4200. module.  However, messages passed from that window to the 32-bit module may 
  4201. also require thunking.  In order to perform this thunking, the 32-bit 
  4202. application can define a thunk procedure and register this procedure to PM, 
  4203. which then invokes the thunk procedure whenever a message is passed from within 
  4204. the window. 
  4205.  
  4206. This registration is achieved using the WinSetWindowThunkProc() function, which 
  4207. is illustrated in the following figure. 
  4208.  
  4209. WinSetWindowThunkProc(hWindow,               /* Window handle            */
  4210.                       (PFN)ThunkProc16to32); /* Thunk proc entry point   */
  4211.  
  4212. Mixed Model Programming-WinSetWindowThunkProc() Function 
  4213.  
  4214. The WinSetWindowThunkProc() function call is made from the 32-bit module. Since 
  4215. the window class for the window has been registered in the 16-bit module, PM 
  4216. recognizes that the thunk procedure is to handle 16-bit to 32-bit conversion. 
  4217.  
  4218. A thunk procedure can be deregistered by issuing a WinSetWindowThunkProc() 
  4219. function call with the thunk procedure entry point address set to NULL. 
  4220.  
  4221. Whenever PM invokes a thunk procedure for a message, it passes the normal four 
  4222. parameters accepted by a window procedure, along with the entry point address 
  4223. of the window procedure to which the message was to be passed.  This can be the 
  4224. window procedure defined for the destination window when its class was 
  4225. registered, or a subclass window procedure defined by the application.  Thus, 
  4226. thunking can take place irrespective of whether a window has been subclassed. 
  4227.  
  4228. A sample thunk procedure is shown in the following figure. 
  4229.  
  4230. MRESULT ThunkProc16to32(HWND hwnd,                /* Window handle       */
  4231.                         USHORT usMsg,             /* Message identifier  */
  4232.                         MPARAM lParam1,           /* Message parameters  */
  4233.                         MPARAM lParam2,
  4234.                         PFNWP wpWindow);          /* Window procedure    */
  4235. {
  4236.         switch (usMsg)
  4237.                {
  4238.                case WMP_MSG1:
  4239.                     lParam1=DosSelToFlat(lParam1); /* Thunk parameters    */
  4240.                     lParam2=DosSelToFlat(lParam2);
  4241.                     break;
  4242.                case WMP_MSG2:
  4243.                     lParam1=DosSelToFlat(lParam1); /* Thunk 1st parameter */
  4244.                     break;
  4245.                }
  4246.         return((*wpWindow)(hwnd,                  /* Call window proc    */
  4247.                            usMsg,
  4248.                            lParam1,
  4249.                            lParam2));
  4250. }
  4251.  
  4252. Mixed Model Programming-Thunk Procedure 
  4253.  
  4254. The thunk procedure is invoked whenever a message is passed by the window in 
  4255. the 16-bit module to a window in the 32-bit module.  The thunk procedure is 
  4256. similar in structure to a normal window procedure, but contains cases only for 
  4257. application-defined message classes, since thunking for system-defined message 
  4258. classes is performed by PM. 
  4259.  
  4260. In the figure above, the 16-bit window contains two application-defined message 
  4261. classes, WMP_MSG1 and WMP_MSG2.  The first of these contains pointers in both 
  4262. parameters, and thus both parameters are thunked by the thunk procedure.  The 
  4263. second message class contains a pointer in the first message parameter only; 
  4264. the second may contain an integer or some simple value parameter which does not 
  4265. require explicit thunking. 
  4266.  
  4267. After performing the necessary thunking, the thunk procedure directly calls the 
  4268. window procedure entry point supplied by PM when the thunk procedure is 
  4269. invoked.  Note that this is one of the few instances where direct invocation of 
  4270. a window procedure should be used; the correct sequence of message processing 
  4271. is preserved in this case because the thunk procedure itself is invoked either 
  4272. synchronously or asynchronously by PM, depending upon whether the message was 
  4273. sent or posted by the 16-bit window. 
  4274.  
  4275.  
  4276. ΓòÉΓòÉΓòÉ 3.4.8. Calling 32-Bit Code from 16-Bit Code ΓòÉΓòÉΓòÉ
  4277.  
  4278. There is no mixed model support in the 16-bit tools.  Hence, the 16-bit tools 
  4279. provide no support for flat code.  This leaves the 32-bit module with all 
  4280. responsibilities for making the mixed model executable work correctly. 
  4281.  
  4282. To call 32-bit routines from a 16-bit routine, it is necessary to declare the 
  4283. 32-bit routine with a 16-bit calling convention.  It is also necessary for the 
  4284. 16-bit routine to get the address of the 32-bit routine in a 16:16 form.  This 
  4285. is done by passing the address of the 32-bit routine to the 16-bit routine, and 
  4286. having the 16-bit routine call the 32-bit routine through a function pointer. 
  4287. The following code fragment illustrates this point: 
  4288.  
  4289. /* 16.C */
  4290.  
  4291. void _Far16 _Pascal fn16 (void (* _Far _Pascal fnptr)(char *), char * text)
  4292. {
  4293.    fnptr (text);
  4294.    return;
  4295. }
  4296.  
  4297. /* 32.C */
  4298. #include <stdio.h>
  4299. void _Far16 _Pascal fn32 (char * text)
  4300. {
  4301.    printf ("%s\n",text);
  4302.    return;
  4303. }
  4304. void _Far16 _Pascal fn16 (void (* _Far16 _Pascal)(char *), char *);
  4305. int main (void)
  4306. {
  4307.    fn16 (fn32, "Hello, world");
  4308.    return 0;
  4309. }
  4310.  
  4311. Calling 32-Bit Code from 16-Bit Code 
  4312.  
  4313. This example calls the fn16 routine, passing to it the address of the 32-bit 
  4314. routine fn32, plus a string to be printed.  Fn16 calls fn32 through the 
  4315. function pointer fnptr, and fn32 converts its parameter to a flat pointer upon 
  4316. entry, switches into 32-bit mode, runs, and then switches back to 16-bit mode 
  4317. for the return to fn16. 
  4318.  
  4319. This sample was written using IBM C Set/2 keywords.  If you use a different 
  4320. compiler, use the keywords your compiler employs to achieve the same effect. 
  4321.  
  4322.  
  4323. ΓòÉΓòÉΓòÉ 3.5. Migrating to OS/2 2.0 ΓòÉΓòÉΓòÉ
  4324.  
  4325. If you have already made significant progress on a 16-bit OS/2 application, you 
  4326. can complete the application for that environment.  Although your application 
  4327. will not take advantage of the features of 32-bit OS/2, it will run in that 
  4328. environment, allowing users to make use of the application until you complete 
  4329. your 32-bit revision. 
  4330.  
  4331. If you are just beginning development of your application, you should consider 
  4332. developing both a 16-bit and 32-bit version of your application by using one of 
  4333. the following strategies: 
  4334.  
  4335.  1. Write a 16-bit application but include 80386 code. 
  4336.  
  4337.     Gear the application for 16-bit OS/2, but include conditional 80386 code 
  4338.     that can be used at run time if the software is run on a 80386 machine. 
  4339.     (This can be useful for spreadsheet recalculations, for example, where the 
  4340.     availability of the 80386 instruction set adds significantly to the 
  4341.     application's performance.) 
  4342.  
  4343.     Advantages:  The application will be able to run under both 16- and 32-bit 
  4344.     versions.  In addition, it will offer improved performance transparently 
  4345.     when run on a 80386 machine. 
  4346.  
  4347.     Disadvantages:  No linear memory management will be available.  The 
  4348.     application will be more difficult to port to other 32-bit flat model 
  4349.     platforms.  You will need to develop and support both 80386 and 80286 code 
  4350.     in the application. 
  4351.  
  4352.  2. Create conditional source code for 16- and 32-bit versions. 
  4353.  
  4354.     A single program source can be used with conditional compilation to produce 
  4355.     executables for either a 16- or 32-bit format. 
  4356.  
  4357.     Advantages:  Provides maximum market coverage.  The 80386 version can take 
  4358.     advantage of the improved instruction set, linear memory, and so on. 
  4359.  
  4360.     Disadvantages:  Requires two sets of development files (include files and 
  4361.     libraries) and both versions of a compiler and an assembler.  Source code 
  4362.     is larger and more difficult to maintain. Functions that take advantage of 
  4363.     linear memory or other OS/2 2.0-specific functions must be written twice 
  4364.     and conditionally compiled to create the appropriate version. 
  4365.  
  4366.  3. Support 16- and 32-bit sources. 
  4367.  
  4368.     Develop and maintain both a 16-bit and a 32-bit version of the application. 
  4369.  
  4370.     Advantages:  Provides maximum market coverage.  The 2.0 version has all the 
  4371.     benefits of a 32-bit application. 
  4372.  
  4373.     Disadvantages:  Separate source code may make future changes easier, since 
  4374.     a straightforward 80386 version already exists. 
  4375.  
  4376. To guarantee unique names in the libraries, all 32-bit functions include the 
  4377. number "32" in the function name (for example, Dos32Open). In the header files, 
  4378. the 32-bit functions names are aliased so that you use only the standard name 
  4379. (for example, DosOpen) in your source file and let the compiler automatically 
  4380. replace it with the actual name.  The compiler chooses the correct alias based 
  4381. on the development model selected. 
  4382.  
  4383.  
  4384. ΓòÉΓòÉΓòÉ 3.6. Summary ΓòÉΓòÉΓòÉ
  4385.  
  4386. OS/2 2.0 supports four types of applications:  full-screen, windowable, PM, and 
  4387. DOS/Windows.  A full-screen application is any OS/2 application that does not 
  4388. create a PM message queue, and does not rely on the PM mouse and keyboard 
  4389. processing for input.  A windowable application is a full-screen application 
  4390. that also can run in a window, or PM session.  A PM application is any OS/2 
  4391. application that creates a message queue.  Generally, PM applications create 
  4392. one or more windows to interact with the user.  A DOS/Windows application runs 
  4393. in an OS/2 DOS session in the protected, virtual 8086 mode of the 80386 
  4394. microprocessor.  A DOS/Windows application can be full-screen or windowed, and 
  4395. it can be run concurrently with other applications. 
  4396.  
  4397. OS/2 applications can be further classified as pure 16-bit, mixed 16-bit, pure 
  4398. 32-bit, and mixed 32-bit applications.  Pure 16-bit applications can be run 
  4399. under the 16-bit and 32-bit versions of the operating system, but cannot take 
  4400. advantage of the features of the 32-bit programming environment.  Mixed 32-bit 
  4401. applications can only be run under the 32-bit version of the operating system. 
  4402. Like pure 16-bit OS/2 applications, they do not have access to the 32-bit 
  4403. virtual address space; however, because they have a 32-bit EXE format, they can 
  4404. take advantage of demand paging.  Pure 32-bit applications incorporate the flat 
  4405. memory model and protection mechanisms which are common on a wide range of 
  4406. computer industry hardware platforms.  They can only run under the 32-bit 
  4407. version of the operating system.  Mixed 32-bit applications can run only under 
  4408. the 32-bit version of the operating system, although they can use 16-bit APIs. 
  4409. These applications can access the entire 32-bit virtual address space. 
  4410.  
  4411. OS/2 2.0 provides different entry points for 16-bit and 32-bit APIs, making it 
  4412. possible to mix 16- and 32-bit code within a single EXE module.  It also is 
  4413. possible to call 32-bit APIs from a 16-bit C program, and to call 16-bit APIs 
  4414. from a 32-bit C program.  To support this, two different libraries-OS2286.LIB 
  4415. and OS2386.LIB-are supported and changes have been made to the include file 
  4416. architecture and to the compiler (such adding new keywords to support calling 
  4417. 16-bit functions). 
  4418.  
  4419. In OS/2 2.0, the system supplies an interface between 16-bit and 32-bit code, 
  4420. called a thunking layer.  The thunking layer translates calls to 16-bit 
  4421. functions into calls to 32-bit functions and calls to 32-bit functions into 
  4422. calls to 16-bit functions.  In performing these translations, the thunk must 
  4423. take the following into account: 
  4424.  
  4425. o Different memory models between the 16-bit version and 32-bit version of the 
  4426.   operating system.  The 16-bit segmented memory model needs to be mapped onto 
  4427.   the 32-bit flat memory model in such a way that addresses can be quickly 
  4428.   converted.  This mapping is accomplished through a technique called tiling. 
  4429.   The API functions, DosFlatToSel and DosSelToFlat, are used to convert 32-bit 
  4430.   flat addresses to 16-bit segmented addresses and 16-bit segmented addresses 
  4431.   to 32-bit flat addresses. 
  4432.  
  4433. o Different parameter sizes 
  4434.  
  4435. o 64K segment boundary problems 
  4436.  
  4437. o Different call models. 
  4438.  
  4439.  
  4440. ΓòÉΓòÉΓòÉ 4. Comparison of 16-Bit and 32-Bit OS/2 Functions ΓòÉΓòÉΓòÉ
  4441.  
  4442. This chapter describes the differences between 16-bit and 32-bit OS/2 functions 
  4443. for: 
  4444.  
  4445. o Control Program 
  4446. o Presentation Manager. 
  4447.  
  4448. Note:  Specific uses of the OS/2 API functions are demonstrated in the Toolkit 
  4449. sample programs. 
  4450.  
  4451.  
  4452. ΓòÉΓòÉΓòÉ 4.1. Changes to the Control Program ΓòÉΓòÉΓòÉ
  4453.  
  4454. There are two types of changes to Control Program functions: name changes and 
  4455. replacements or enhancements. 
  4456.  
  4457. Many of the 16-bit function names were changed to be more consistent in the 
  4458. 32-bit release.  The guidelines used to name functions are: 
  4459.  
  4460. o Compliance with Get, Set, and Query semantics used in PM-SAA conventions 
  4461. o Use of action verbs before nouns 
  4462. o Use of consistent semantics for similar actions. 
  4463.  
  4464. File-system functions are significantly affected by name changes. 
  4465.  
  4466. Some 16-bit functions have been completely redesigned for the 32-bit version of 
  4467. the operating system.  This is particularly true in memory-management, 
  4468. semaphore, and signal functions. 
  4469.  
  4470. Functions for the 32-bit operating system are described in the OS/2 2.0 
  4471. Technical Library and the OS/2 2.0 Toolkit. Some 16-bit functions are not 
  4472. supported by 32-bit code.  These functions, though still supported by OS/2 2.0, 
  4473. are described in the OS/2 2.0 Control Program Programming Reference. 
  4474.  
  4475.  
  4476. ΓòÉΓòÉΓòÉ 4.1.1. Memory Management ΓòÉΓòÉΓòÉ
  4477.  
  4478. The 16-bit version of the operating system uses a segmented-memory model. 
  4479. Applications can request segments as large as 64KB. They access data in those 
  4480. segments through pointers consisting of 16-bit selectors and offsets. 
  4481.  
  4482. In the 32-bit OS/2 version of the operating system: 
  4483.  
  4484. o Memory is requested by object, not by segment.  Functions that allocate 
  4485.   memory return 32-bit pointers to memory objects ranging in size from 1 page 
  4486.   (page=4K) to any size supported by available swap space, to a maximum of 
  4487.   448MB.  Swap space refers to external storage devices used to store code and 
  4488.   data that is not required for immediate processor execution. 
  4489.  
  4490. o All pointer references are 32-bit near pointers.  No segment register loads 
  4491.   are involved; thus all of the segment registers are equal:  DS=SS=ES. 
  4492.  
  4493. o Virtual memory works by demand paging, rather than by compaction and segment 
  4494.   swapping.  This has important implications for sizing memory objects for 
  4495.   optimum system performance. 
  4496.  
  4497. All memory allocations in the 32-bit version of the operating system, whether 
  4498. private or shared, initialize committed pages to all zeros. Programs can rely 
  4499. on this when determining the initial contents of memory. 
  4500.  
  4501. The following table summarizes the 16-bit and corresponding 32-bit 
  4502. memory-management functions. 
  4503.  
  4504. 16-Bit to 32-Bit Memory-Management Functions 
  4505.  
  4506. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4507. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  4508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4509. ΓöéDosAllocSeg                   ΓöéN/A                           Γöé
  4510. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4511. ΓöéDosAllocShrSeg                ΓöéN/A                           Γöé
  4512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4513. ΓöéDosGetShrSeg                  ΓöéN/A                           Γöé
  4514. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4515. ΓöéDosGetSeg                     ΓöéN/A                           Γöé
  4516. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4517. ΓöéDosGiveSeg                    ΓöéN/A                           Γöé
  4518. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4519. ΓöéDosReallocSeg                 ΓöéN/A                           Γöé
  4520. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4521. ΓöéDosFreeSeg                    ΓöéN/A                           Γöé
  4522. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4523. ΓöéDosAllocHuge                  ΓöéN/A                           Γöé
  4524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4525. ΓöéDosGetHugeShift               ΓöéN/A                           Γöé
  4526. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4527. ΓöéDosReallocHuge                ΓöéN/A                           Γöé
  4528. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4529. ΓöéDosCreateCSAlias              ΓöéN/A                           Γöé
  4530. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4531. ΓöéDosLockSeg                    ΓöéN/A                           Γöé
  4532. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4533. ΓöéDosUnlockSeg                  ΓöéN/A                           Γöé
  4534. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4535. ΓöéDosMemAvail                   ΓöéN/A                           Γöé
  4536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4537. ΓöéDosSizeSeg                    ΓöéN/A                           Γöé
  4538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4539. ΓöéDosSubAllocMem                ΓöéDosSubAllocMem                Γöé
  4540. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4541. ΓöéDosSubFreeMem                 ΓöéDosSubFreeMem                 Γöé
  4542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4543. ΓöéDosSubSetMem                  ΓöéDosSubSetMem                  Γöé
  4544. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4545. ΓöéN/A                           ΓöéDosSubUnsetMem                Γöé
  4546. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4547. ΓöéN/A                           ΓöéDosAllocMem                   Γöé
  4548. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4549. ΓöéN/A                           ΓöéDosAllocSharedMem             Γöé
  4550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4551. ΓöéN/A                           ΓöéDosGetNamedSharedMem          Γöé
  4552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4553. ΓöéN/A                           ΓöéDosGetSharedMem               Γöé
  4554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4555. ΓöéN/A                           ΓöéDosGiveSharedMem              Γöé
  4556. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4557. ΓöéN/A                           ΓöéDosFreeMem                    Γöé
  4558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4559. ΓöéN/A                           ΓöéDosSetMem                     Γöé
  4560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4561. ΓöéN/A                           ΓöéDosQueryMem                   Γöé
  4562. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4563.  
  4564.  
  4565. ΓòÉΓòÉΓòÉ 4.1.1.1. Allocating Memory ΓòÉΓòÉΓòÉ
  4566.  
  4567. Version        Functions 
  4568.  
  4569. 16-bit         DosAllocSeg, DosAllocHuge 
  4570.  
  4571. 32-bit         DosAllocMem 
  4572.  
  4573. The 32-bit function replaces both 16-bit functions.  The new allocation scheme 
  4574. has several concepts specific to the paged environment.  Among them is the 
  4575. ability to control access to the memory object and to control when to commit 
  4576. the pages. 
  4577.  
  4578. The following example illustrates a typical request for 68KB of memory under 
  4579. both the 16-bit and 32-bit versions of the operating system. 
  4580.  
  4581. 16-Bit:
  4582.  
  4583.  SEL sel1, sel2;
  4584.  PBYTE pabObject1, pabObject2;
  4585.  USHORT offSelector, usShiftCount;
  4586.  
  4587.  /* Method 1 -- allocate two selectors. */
  4588.  
  4589.  DosAllocSeg(0, &sel1, SEG_NONSHARED);
  4590.  DosAllocSeg(4096, &sel2, SEG_NONSHARED);
  4591.  pabObject1 = MAKEP(sel1, 0);
  4592.  pabObject2 = MAKEP(sel2, 0);
  4593.  
  4594.  /* Code must use pabObject2 for memory references above 64KB. */
  4595.  
  4596.  
  4597.  /* Method 2 -- use DosAllocHuge. */
  4598.  
  4599.  DosGetHugeShift(&usShiftCount);
  4600.  offSelector = 1 << usShiftCount;
  4601.  DosAllocHuge(1, 4096, &sel1, 2, SEG_NONSHARED);
  4602.  pabObject1 = MAKEP(sel1, 0);
  4603.  pabObject2 = MAKEP(sel1 + offSelector, 0);
  4604.  
  4605.  /* Code can use pabObject1 and pabObject2 as above, or take advantage of
  4606.   * the arrangement of the huge selectors by using pointers of the type
  4607.   * pab = MAKEP(sel1 + offset >> 16, offset / 16). */
  4608.  
  4609. 32-Bit:
  4610.  
  4611.  PBYTE pabObject;
  4612.  
  4613.  DosAllocMem(&pabObject, 69632, PAG_COMMIT | PAG_READ | PAG_WRITE);
  4614.  
  4615. Allocating Memory 
  4616.  
  4617. Both the 16-bit and 32-bit code shown allocate 69 632 bytes, returning a 
  4618. pointer to the first byte in pabObject (or pabObject1).  The memory has both 
  4619. read and write access, the typical permission for dynamically allocated memory 
  4620. objects.  In addition, the pages are committed when the call returns, and 
  4621. storage space for the objects is reserved; the program can now make memory 
  4622. references for reading or writing to the range, pabObject through pabOjbect 
  4623. plus 69 631. Under the segmented architecture, programs cannot read past the 
  4624. first 64KB without changing the selector.  In the 32-bit version, the entire 
  4625. range of addresses corresponding to the object is directly accessible. 
  4626.  
  4627. In the preceding example, note that the paged memory requested has a 
  4628. granularity of 4KB; exactly 68KB has been requested. Granularity is the unit of 
  4629. memory allocation specific to an operating system and hardware platform.  The 
  4630. granularity is 4KB for OS/2 2.0 and 16 bytes to 64,000 bytes for 16-bit 
  4631. versions of the operating system. Had 68KB plus 1 byte been requested, the 
  4632. system would have to commit 72KB of memory; the extra single byte would use up 
  4633. 4KB of the linear address space.  Although pages of memory will be swapped out 
  4634. as needed, directly allocating many small objects with the DosAllocMem function 
  4635. is inefficient.  Instead, use the DosSubAllocMem function or the C library 
  4636. malloc routines.  (Malloc is a standard C generic method which translates a 
  4637. programmer's request for memory allocation to the specific operating system 
  4638. implementation of memory allocation.  This technique removes some operating 
  4639. system dependent code from the C programmer.)  You also can implement your own 
  4640. heap by requesting a large, page-aligned block and subdividing it as needed by 
  4641. your code.  A heap is a large, allocated memory region that is subdivided for 
  4642. private use.  When writing applications expected to run under the 32-bit and 
  4643. earlier versions, remember that the DosAllocSeg function will not pack segments 
  4644. into the same page.  Segment sizes of 16KB to 32KB are a reasonable compromise 
  4645. for code that must run under either system. (Larger segments become more 
  4646. efficient under paging, but less efficient under segmentation.) 
  4647.  
  4648.  
  4649. ΓòÉΓòÉΓòÉ 4.1.1.2. Freeing Memory ΓòÉΓòÉΓòÉ
  4650.  
  4651. Version        Functions 
  4652.  
  4653. 16-bit         DosFreeSeg 
  4654.  
  4655. 32-bit         DosFreeMem 
  4656.  
  4657. These functions release previously allocated, private or shared, memory 
  4658. objects.  For DosFreeMem, the address should always be the base address 
  4659. returned by a call to the DosAllocMem function.  With shared memory, the 
  4660. associated reference count is decremented by one; when all holders have 
  4661. released the shared memory, the system will reclaim the space.  The DosFreeSeg 
  4662. function also is used to release selectors granted for huge memory and code 
  4663. aliasing (a feature of 286 architecture and OS/2 Version 1.X implementation 
  4664. which allows multiple selectors to reference the same code segment), which are 
  4665. not needed under under the 32-bit version. 
  4666.  
  4667. The following example shows how to release memory under both 16-bit and 32-bit 
  4668. versions. 
  4669.  
  4670. 16-Bit:
  4671.  
  4672.  SEL sel;
  4673.  
  4674.  DosFreeSeg(sel);
  4675.  
  4676. 32-bit:
  4677.  
  4678.  PBYTE pabObject;
  4679.  
  4680.  DosFreeMem(pabObject);
  4681.  
  4682. Freeing Memory 
  4683.  
  4684.  
  4685. ΓòÉΓòÉΓòÉ 4.1.1.3. Suballocating Memory ΓòÉΓòÉΓòÉ
  4686.  
  4687. Version        Functions 
  4688.  
  4689. 16-bit         DosSubSet, DosSubAlloc, DosSubFree 
  4690.  
  4691. 32-bit         DosSubSetMem, DosSubAllocMem, DosSubFreeMem, DosSubUnsetMem 
  4692.  
  4693. Suballocation enables large memory object to be subdivided. DosSubAllocMem and 
  4694. DosSubFreeMem allow a simple heap arrangement, with low performance 
  4695. requirements (few instructions required to perform repetitive allocating and 
  4696. freeing of small memory blocks), that is sufficient for many memory operations. 
  4697. This allocation package normally will serialize requests made by different 
  4698. threads within a process (when using WinAllocMem, the application must provide 
  4699. for synchronization). The following table shows the differences for the 
  4700. DosSubSetMem function. 
  4701.  
  4702. 16-Bit and 32-Bit DosSubSetMem 
  4703.  
  4704. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4705. ΓöéFeature             Γöé16-Bit              Γöé32-Bit              Γöé
  4706. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4707. ΓöéGranularity of size Γöé4 bytes             Γöé8 bytes             Γöé
  4708. Γöéfor DosSubSetMem andΓöé                    Γöé                    Γöé
  4709. ΓöéDosSubAllocMem      Γöé                    Γöé                    Γöé
  4710. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4711. ΓöéMinimum size for    Γöé12 bytes: 8-byte    Γöé40 bytes: 32-byte   Γöé
  4712. ΓöéDosSubSetMem        Γöéheader plus 4-byte  Γöéheader plus 8-byte  Γöé
  4713. Γöé                    Γöéallocation region.  Γöéallocation region.  Γöé
  4714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4715. ΓöéWhen DosSubSetMem = ΓöéA request of 64KB.  ΓöéA request of 4GB (GBΓöé
  4716. Γöé0                   Γöé                    Γöéequals 1 073 741 824Γöé
  4717. Γöé                    Γöé                    Γöébytes). (**this callΓöé
  4718. Γöé                    Γöé                    Γöéwill fail due to notΓöé
  4719. Γöé                    Γöé                    Γöéenough memory **)   Γöé
  4720. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4721. ΓöéMaximum size of     ΓöéSegment size: 12    ΓöéObject size:  32    Γöé
  4722. Γöérequest for         Γöébytes (reserved for Γöébytes (reserved for Γöé
  4723. ΓöéDosSubAllocMem      Γöéheader).            Γöéheader).            Γöé
  4724. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4725. ΓöéSerialization of    ΓöéAlways.             ΓöéSelectable.         Γöé
  4726. Γöérequests            Γöé                    Γöé                    Γöé
  4727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4728. ΓöéAdditional flags    ΓöéNone.               ΓöéThe requestor wants Γöé
  4729. Γöé                    Γöé                    Γöéa suballocating     Γöé
  4730. Γöé                    Γöé                    Γöéfunction to manage  Γöé
  4731. Γöé                    Γöé                    Γöéthe commitment of   Γöé
  4732. Γöé                    Γöé                    Γöéthe pages spanned byΓöé
  4733. Γöé                    Γöé                    Γöéthe memory pool; theΓöé
  4734. Γöé                    Γöé                    Γöérequestor requires  Γöé
  4735. Γöé                    Γöé                    Γöéaccess to the memoryΓöé
  4736. Γöé                    Γöé                    Γöépool to be          Γöé
  4737. Γöé                    Γöé                    Γöéserialized.         Γöé
  4738. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4739.  
  4740. In both 16-bit and 32-bit versions, the maximum size for DosSubSetMem is the 
  4741. size of the memory object being used for the heap.  Because memory requests may 
  4742. be larger than 64KB in the 32-bit version, the new version of DosSubSetMem 
  4743. provides more flexibility in choosing the size of the heap, and removes any 
  4744. external barriers to size limits for data objects within the heap.  Also, both 
  4745. versions initially allow the size requested in DosSubSetMem to be less than the 
  4746. size of the segment (16-bit version) or object (32-bit version).  The 
  4747. suballocator then uses the low area of the segment (object) for its allocation 
  4748. region.  If DosSubSetMem later is used to make the allocation region larger, 
  4749. the memory currently in use (including the organization information in the 
  4750. header) is guaranteed to remain valid.  For all versions, DosSubFreeMem must 
  4751. include the size of the object being freed; the suballocator does not maintain 
  4752. the size of each object, and space that is not freed remains locked. 
  4753.  
  4754. The following example demonstrates the suballocation and freeing of 16 bytes 
  4755. from a 4KB memory object. 
  4756.  
  4757.  16-Bit:
  4758.  
  4759.  SEL sel;
  4760.  USHORT usOffset;
  4761.  PBYTE pabSmallObject;
  4762.  
  4763.  DosAllocSeg(4096, &sel, SEG_NONSHARED);
  4764.  DosSubSet(sel, 1, 4096);    /* uses entire region for suballocation */
  4765.  
  4766.  DosSubAlloc(sel, &usOffset, 16);               /* requests 16 bytes */
  4767.  pabSmallObject = MAKEP (sel, usOffset);
  4768.  
  4769.      .
  4770.      .
  4771.      .
  4772.  
  4773.  DosSubFree(sel, usOffset, 16);    /* frees all 16 bytes */
  4774.  
  4775.  32-Bit:
  4776.  
  4777.  PBYTE pabObject, pabSmallObject;
  4778.  
  4779.  DosAllocMem(&pabObject, 4096, PAG_COMMIT | PAG_READ | PAG_WRITE);
  4780.  DosSubSetMem(pabObject, 1, 4096);/* uses entire region for suballocation */
  4781.  
  4782.  DosSubAllocMem(pabObject, &pabSmallObject, 16); /* requests 16 bytes     */
  4783.  
  4784.      .
  4785.      .
  4786.      .
  4787.  
  4788.  DosSubFreeMem(pabObject, pabSmallObject, 16);   /* frees all 16 bytes    */
  4789.  
  4790. Suballocating Memory 
  4791.  
  4792.  
  4793. ΓòÉΓòÉΓòÉ 4.1.1.4. Using Named Shared Memory ΓòÉΓòÉΓòÉ
  4794.  
  4795. Version        Functions 
  4796.  
  4797. 16-bit         DosAllocShrSeg, DosGetShrSeg 
  4798.  
  4799. 32-bit         DosAllocSharedMem, DosGetNamedSharedMem 
  4800.  
  4801. Named shared memory enables any process that specifies the correct name to gain 
  4802. access to the shared segment.  One process must allocate the shared segment 
  4803. initially; others then can gain access by using the DosGetShrSeg function. 
  4804. Named shared memory uses the file-system name space; all names must be of the 
  4805. form, \sharemem\name, where name represents a valid file name.  The system will 
  4806. not allow subsequent calls that attempt to allocate named memory to a name 
  4807. already in use. 
  4808.  
  4809. The following example demonstrates the allocation and subsequent sharing of a 
  4810. named segment. 
  4811.  
  4812.  16-bit:
  4813.  
  4814.  SEL sel;
  4815.  
  4816.  /* Process 1. */
  4817.  
  4818.  DosAllocShrSeg(4096, "\\sharemem\\mystuff", &sel);
  4819.  
  4820.  
  4821.  /* Process 2 must come AFTER segment has been allocated by process 1. */
  4822.  
  4823.  DosGetShrSeg("\\sharemem\\mystuff", &sel);
  4824.  
  4825.  32-bit:
  4826.  
  4827.  PBYTE pabSharedObject;
  4828.  
  4829.  /* Process 1. */
  4830.  
  4831.  DosAllocSharedMem(&pabSharedObject, "\\sharemem\\mystuff", 4096,
  4832.      PAG_COMMIT | PAG_READ | PAG_WRITE);
  4833.  
  4834.  
  4835.  /* Process 2 must come AFTER memory has been allocated by process 1. */
  4836.  
  4837.  DosGetNamedSharedMem(&pabSharedObject, "\\sharemem\\mystuff",
  4838.      PAG_READ | PAG_WRITE);
  4839.  
  4840. Using Named Shared Memory 
  4841.  
  4842. Both processes can read from and write to the shared segment.  The selectors 
  4843. returned to the cooperating processes in the 16-bit version will refer to the 
  4844. same virtual-memory segment.  The pointers returned in the 32-bit version are 
  4845. guaranteed to be identical for identical names; that is, the shared memory lies 
  4846. at the same virtual address in each process. 
  4847.  
  4848.  
  4849. ΓòÉΓòÉΓòÉ 4.1.1.5. Using Unnamed Shared Memory ΓòÉΓòÉΓòÉ
  4850.  
  4851. Version        Functions 
  4852.  
  4853. 16-bit         DosGiveSeg, DosGetSeg 
  4854.  
  4855. 32-bit         DosGiveSharedMem, DosGetSharedMem 
  4856.  
  4857. Unnamed shared memory requires that the process allocating the memory object 
  4858. transfer a handle to it to another process.  (The initial process must know the 
  4859. process identifier of the recipient.)  Unnamed shared memory does not 
  4860. communicate through the file-system name space. 
  4861.  
  4862. The following example demonstrates how a memory segmentis allocated. 
  4863.  
  4864.  16-Bit:
  4865.  
  4866.  SEL sel, selRecipient;
  4867.  PID pidRecipient;
  4868.  
  4869.  DosAllocSeg(4096, &sel, SEG_GIVEABLE);
  4870.  DosGiveSeg(sel, pidRecipient, &selRecipient);
  4871.  
  4872.  /* Use some IPC mechanism to transmit selRecipient. */
  4873.  
  4874.  32-Bit:
  4875.  
  4876.  PBYTE pabSharedObject;
  4877.  PID pidRecipient;
  4878.  
  4879.  DosAllocSharedMem(&pabSharedObject, (PSZ) NULL, 4096,
  4880.      PAG_COMMIT | OBJ_GIVEABLE | PAG_READ | PAG_WRITE);
  4881.  DosGiveSharedMem(pabSharedObject, pidRecipient, PAG_READ | PAG_WRITE);
  4882.  
  4883.  /* Use some IPC mechanism to transmit pabSharedObject. */
  4884.  
  4885. Giving Unnamed Shared Memory 
  4886.  
  4887. The following example demonstrates how a segment is obtained. 
  4888.  
  4889.  16-Bit:
  4890.  
  4891.  /* Process 1. */
  4892.  SEL selShared;
  4893.  
  4894.  DosAllocSeg(4096, &selShared, SEG_GETTABLE);
  4895.  
  4896.  /* Use some IPC mechanism to transmit selShared. */
  4897.  
  4898.  /* Process 2, receive selShared via IPC mechanism. */
  4899.  SEL sel;
  4900.  
  4901.  DosGetSeg(sel);
  4902.  
  4903.  32-Bit:
  4904.  
  4905.  /* Process 1. */
  4906.  PBYTE pabSharedObject;
  4907.  
  4908.  DosAllocSharedMem(&pabSharedObject, (PSZ) NULL, 4096,
  4909.      PAG_COMMIT | OBJ_GETABLE | PAG_READ | PAG_WRITE);
  4910.  
  4911.  /* Use some IPC mechanism to transmit pabSharedObject. */
  4912.  
  4913.  /* Process 2, receive pabSharedObject via IPC mechanism .*/
  4914.  PBYTE pabSharedObject;
  4915.  
  4916.  DosGetSharedMem(pabSharedObject, PAG_READ | PAG_WRITE);
  4917.  
  4918. Getting Unnamed Shared Memory 
  4919.  
  4920.  
  4921. ΓòÉΓòÉΓòÉ 4.1.1.6. Generating Dynamic Code ΓòÉΓòÉΓòÉ
  4922.  
  4923. Version        Functions 
  4924.  
  4925. 16-bit         DosCreateCSAlias 
  4926.  
  4927. 32-bit         DosAllocMem 
  4928.  
  4929. Before the 32-bit version of the operating system, programs requiring that code 
  4930. be generated during execution used the DosCreateCSAlias function.  A data 
  4931. segment would be used to write the operation codes (opcodes), then 
  4932. DosCreateCSAlias would return a new code segment, which could be used to make a 
  4933. call to the dynamically compiled code.  With the 32-bit version of the 
  4934. operating system, the DosAllocMem function, specifying PAG_WRITE | PAG_EXECUTE 
  4935. access, is used for writing in the memory object and for making it executable. 
  4936.  
  4937. The following example demonstrates the generation and execution of 
  4938. program-compiled code. 
  4939.  
  4940.  16-Bit
  4941.  
  4942.  SEL selData, selCode;
  4943.  LONG (PASCAL FAR *SampleFunction) (PSZ pszParam1, USHORT usParam2);
  4944.  LONG lReturn;
  4945.  PBYTE pabFunction;
  4946.  
  4947.  DosAllocSeg(4096, &selData, SEG_NONSHARED);
  4948.  pabFunction = MAKEP(selData, 0);
  4949.  
  4950.  /* Write program into memory by using pabFunction. */
  4951.         .
  4952.         .
  4953.  /* Alias code selector to selData. */
  4954.  DosCreateCSAlias(selData, &selCode);
  4955.  
  4956.  /* Free data selector. Only needed to write program. */
  4957.  DosFreeSeg(selData);
  4958.  SampleFunction = (LONG (PASCAL FAR *)(PSZ, USHORT))(MAKEP(selCode, 0));
  4959.  
  4960.  lReturn = (*SampleFunction)("Hello", 5);
  4961.  
  4962.  /* Done with code selector. */
  4963.  DosFreeSeg(selCode);
  4964.  
  4965.  32-Bit:
  4966.  
  4967.  PBYTE pabFunction;
  4968.  LONG (*SampleFunction) (PSZ pszParam1, USHORT usParam2);
  4969.  LONG lReturn;
  4970.  
  4971.  /* ... */
  4972.  
  4973.  DosAllocMem(&pabFunction, 4096,
  4974.      PAG_COMMIT | PAG_WRITE | PAG_EXECUTE);
  4975.     .
  4976.     . /* Write program into memory by using pabFunction. */
  4977.     .
  4978.  
  4979.  SampleFunction = (LONG (*)(PSZ, USHORT))pabFunction;
  4980.  lReturn = (*SampleFunction)("Hello", 5);
  4981.  
  4982.  /* Done with code memory object. */
  4983.  DosFreeMem(pabFunction);
  4984.  
  4985. Generating Dynamic Code 
  4986.  
  4987.  
  4988. ΓòÉΓòÉΓòÉ 4.1.1.7. Determining Available Memory ΓòÉΓòÉΓòÉ
  4989.  
  4990. Version        Functions 
  4991.  
  4992. 16-bit         DosMemAvail 
  4993.  
  4994. 32-bit         No equivalent 
  4995.  
  4996. The DosMemAvail function was used in earlier versions of the operating system 
  4997. to return the largest consecutive block of free memory available without 
  4998. resorting to the swapping, moving, or discarding of segments. Because this 
  4999. function is not serialized with system functions, the value returned will only 
  5000. be accurate when it is determined by the function, and not necessarily after 
  5001. the system returns to the issuing code.  Therefore, the only practical use for 
  5002. the function is to measure system-memory load.  No corresponding function 
  5003. exists in the current 32-bit version. 
  5004.  
  5005.  
  5006. ΓòÉΓòÉΓòÉ 4.1.1.8. Discarding Memory Objects ΓòÉΓòÉΓòÉ
  5007.  
  5008. Version        Functions 
  5009.  
  5010. 16-bit         DosLockSeg, DosUnlockSeg 
  5011.  
  5012. 32-bit         No equivalent 
  5013.  
  5014. Earlier segmented versions of the operating system allowed the discarding of 
  5015. segments as one means of managing virtual memory.  Information that a program 
  5016. could easily regenerate could be stored in a discardable segment, rather than 
  5017. being swapped to disk.  The 32-bit version of the operating system uses 
  5018. least-recently-used swapping for its memory-overcommitment feature and does not 
  5019. support the discarding of pages.  Memory overcommitment is the ratio between 
  5020. the amount of code and data that the operating system is capable of executing 
  5021. or referencing and the available physical storage.  If the available physical 
  5022. storage is less than the amount of code and data, the difference is kept on the 
  5023. swap space.  This may lead to larger swap-space requirements for programs that 
  5024. make extensive use of discardable objects.  The DosLockSeg and DosUnlockSeg 
  5025. functions have no counterparts in the 32-bit system, and the allocation flag, 
  5026. SEG_DISCARDABLE, is not used. 
  5027.  
  5028.  
  5029. ΓòÉΓòÉΓòÉ 4.1.1.9. Setting Memory Commitment and Access ΓòÉΓòÉΓòÉ
  5030.  
  5031. Version        Functions 
  5032.  
  5033. 16-bit         No equivalent 
  5034.  
  5035. 32-bit         DosSetMem 
  5036.  
  5037. Pages that are not committed at allocation time can be selectively committed 
  5038. with the DosSetMem function.  This function also can be used to change the 
  5039. access type of committed pages of memory.  These functions have no counterparts 
  5040. in earlier versions of the operating system. 
  5041.  
  5042.  
  5043. ΓòÉΓòÉΓòÉ 4.1.1.10. Checking a Process's Virtual-Memory Map ΓòÉΓòÉΓòÉ
  5044.  
  5045. Version        Functions 
  5046.  
  5047. 16-bit         No equivalent 
  5048.  
  5049. 32-bit         DosQueryMem 
  5050.  
  5051. Any thread can identify the current status of the memory map for the 
  5052. corresponding process.  The DosQueryMem function can be called to determine the 
  5053. access, commitment, and private or shared status of blocks of memory.  It is 
  5054. the only function that allows memory addresses outside the range currently 
  5055. allocated to the process.  There is no corresponding function in earlier 
  5056. versions of the operating system. 
  5057.  
  5058.  
  5059. ΓòÉΓòÉΓòÉ 4.1.2. Threads and Processes ΓòÉΓòÉΓòÉ
  5060.  
  5061. OS/2 2.0 supports multiple processes, as well as multiple threads within each 
  5062. process.  The functions supporting process and thread control are very similar 
  5063. in both the 16-bit and 32-bit versions; however, small differences do exist for 
  5064. some functions. The following table shows the 16-bit and corresponding 32-bit 
  5065. functions that support process and thread control. 
  5066.  
  5067. 16-Bit to 32-Bit Tasking Functions 
  5068.  
  5069. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5070. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  5071. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5072. ΓöéDosCreateThread               ΓöéDosCreateThread               Γöé
  5073. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5074. ΓöéDosCWait                      ΓöéDosWaitChild                  Γöé
  5075. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5076. ΓöéN/A                           ΓöéDosWaitThread                 Γöé
  5077. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5078. ΓöéDosEnterCritSec               ΓöéDosEnterCritSec               Γöé
  5079. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5080. ΓöéDosExecPgm                    ΓöéDosExecPgm                    Γöé
  5081. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5082. ΓöéDosExit                       ΓöéDosExit                       Γöé
  5083. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5084. ΓöéDosExitCritSec                ΓöéDosExitCritSec                Γöé
  5085. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5086. ΓöéDosExitList                   ΓöéDosExitList                   Γöé
  5087. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5088. ΓöéDosGetInfoSeg                 ΓöéN/A                           Γöé
  5089. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5090. ΓöéDosGetEnv                     ΓöéDosGetInfoBlocks              Γöé
  5091. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5092. ΓöéDosGetPrty                    ΓöéN/A                           Γöé
  5093. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5094. ΓöéDosKillProcess                ΓöéDosKillProcess                Γöé
  5095. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5096. ΓöéDosSetPrty                    ΓöéDosSetPriority                Γöé
  5097. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5098. ΓöéDosGetPID                     ΓöéN/A                           Γöé
  5099. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5100. ΓöéDosGetPPID                    ΓöéN/A                           Γöé
  5101. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5102. ΓöéDosR2StackRealloc             ΓöéN/A                           Γöé
  5103. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5104. ΓöéDosCallBack                   ΓöéN/A                           Γöé
  5105. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5106. ΓöéDosRetForward                 ΓöéN/A                           Γöé
  5107. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5108. ΓöéN/A                           ΓöéDosDebug                      Γöé
  5109. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5110. ΓöéDosPTrace                     ΓöéN/A                           Γöé
  5111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5112. ΓöéDosResumeThread               ΓöéDosResumeThread               Γöé
  5113. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5114. ΓöéDosSuspendThread              ΓöéDosSuspendThread              Γöé
  5115. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5116. ΓöéDosQSysInfo                   ΓöéDosQuerySysInfo               Γöé
  5117. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5118.  
  5119.  
  5120. ΓòÉΓòÉΓòÉ 4.1.2.1. Creating Threads ΓòÉΓòÉΓòÉ
  5121.  
  5122. Version        Functions 
  5123.  
  5124. 16-bit         DosCreateThread 
  5125.  
  5126. 32-bit         DosCreateThread 
  5127.  
  5128. The 32-bit version of the DosCreateThread function has several new features: 
  5129.  
  5130. o The function pointer is now a near pointer.  Data declared with a near 
  5131.   pointer resides in the default data segment and is referenced with 32-bit 
  5132.   addresses. 
  5133.  
  5134. o Clearing the ES register is no longer required upon entry to the new thread. 
  5135.   Because all threads in a process have ES=DS=SS, memory violations from 
  5136.   accessing a segment cleared by another thread do not occur. 
  5137.  
  5138. o A single doubleword argument can be passed to the newly created thread 
  5139.   through the creation function.  This often will be the address of the 
  5140.   information required by the new thread. 
  5141.  
  5142. o The thread can be started in either the active or the suspended state.  If it 
  5143.   is started in the suspended state, another thread should eventually call the 
  5144.   DosResumeThread function to activate it. 
  5145.  
  5146. o Stack memory is now allocated by the system.  The system will first round 
  5147.   this size up to the nearest page-size boundary (4KB in 32-bit version) and 
  5148.   then use that number to allocate the entire range of stack memory.  Memory 
  5149.   will be committed dynamically for the thread's stack, using the guard-page 
  5150.   feature of the 80386 microprocessor. 
  5151.  
  5152.   In normal operation, memory requests will gradually fill up the current page 
  5153.   until a new request raises a guard-page-entered exception.  The system will 
  5154.   then commit the old guard page and move it down.  Because only one guard page 
  5155.   is used, allocations from the stack greater than 4KB for any thread (even the 
  5156.   initial one) should be handled by a compiler-generated stack probe. 
  5157.  
  5158.  
  5159. ΓòÉΓòÉΓòÉ 4.1.2.2. Controlling Threads ΓòÉΓòÉΓòÉ
  5160.  
  5161. Version        Functions 
  5162.  
  5163. 16-bit         DosSuspendThread, DosResumeThread 
  5164.  
  5165. 32-bit         DosSuspendThread, DosResumeThread 
  5166.  
  5167. These functions perform the same actions.  DosResumeThread also can be used to 
  5168. start execution in threads that were initially created in the suspended state 
  5169. with DosCreateThread. 
  5170.  
  5171.  
  5172. ΓòÉΓòÉΓòÉ 4.1.2.3. Exiting from Threads and Processes ΓòÉΓòÉΓòÉ
  5173.  
  5174. Version        Functions 
  5175.  
  5176. 16-bit         DosExit 
  5177.  
  5178. 32-bit         DosExit 
  5179.  
  5180. DosExit can be used to end the entire process, or a single thread within the 
  5181. process.  There are several important points to remember regarding its use: 
  5182.  
  5183. o The system can create threads for the process, independent of the threads 
  5184.   created by the application.  Therefore, to exit from the process, always use 
  5185.   EXIT_PROCESS, rather than trying to exit from or to end each thread. 
  5186.  
  5187. o In the 32-bit version of the operating system, ending thread 1 (the initial 
  5188.   thread for the process) ends the entire process.  It is equivalent to calling 
  5189.   DosExit with EXIT_PROCESS as the first parameter. 
  5190.  
  5191. o When a process is ending, one thread will be kept active and used to execute 
  5192.   the exit list for the process.  When the execution of the list is completed, 
  5193.   the system will free all resources held by the process, and the process will 
  5194.   end.  The result code (exit code) will be returned to the parent process. 
  5195.  
  5196.  
  5197. ΓòÉΓòÉΓòÉ 4.1.2.4. Ending Other Processes ΓòÉΓòÉΓòÉ
  5198.  
  5199. Version        Functions 
  5200.  
  5201. 16-bit         DosKillProcess 
  5202.  
  5203. 32-bit         DosKillProcess 
  5204.  
  5205. In both the 16-bit and 32-bit versions of the operating system, a process can 
  5206. specify tree termination (ending another process and all its descendants) only 
  5207. if the target is the process itself, or a process begun by it with the 
  5208. DosExecPgm function and an AsyncTraceFlags of 2 (EXEC_ASYNCRESULT).  If the 
  5209. target process has finished, its child processes will still be ended. 
  5210.  
  5211. In all versions, the system erases the contents of system buffers; if internal 
  5212. buffers exist (such as C file buffers), the process must use an exception 
  5213. handler to trap the termination signal, end its functions in an orderly manner, 
  5214. and then exit. 
  5215.  
  5216.  
  5217. ΓòÉΓòÉΓòÉ 4.1.2.5. Handling Critical Sections ΓòÉΓòÉΓòÉ
  5218.  
  5219. Version        Functions 
  5220.  
  5221. 16-bit         DosEnterCritSec, DosExitCritSec 
  5222.  
  5223. 32-bit         DosEnterCritSec, DosExitCritSec 
  5224.  
  5225. These functions operate the same in both the 16-bit and 32-bit versions of the 
  5226. operating system.  The DosEnterCritSec function can generate an overflow error 
  5227. if the count should exceed 65 535; DosExitCritSec can generate an underflow 
  5228. error if the count becomes less than 0.  In either case, the function will not 
  5229. have taken effect.  In all versions of the operating system, the 
  5230. thread-handling signals can still be activated in a critical section and should 
  5231. be written in such a way that it will not interfere with critical resources. 
  5232.  
  5233.  
  5234. ΓòÉΓòÉΓòÉ 4.1.2.6. Waiting for Threads ΓòÉΓòÉΓòÉ
  5235.  
  5236. Version        Functions 
  5237.  
  5238. 16-bit         DosCWait 
  5239.  
  5240. 32-bit         DosWaitChild, DosWaitThread 
  5241.  
  5242. DosCWait and DosWaitChild operate the same in both the 16-bit and 32-bit 
  5243. versions of the operating system.  DosWaitThread is new for the 32-bit version 
  5244. of the operating system.  It enables a thread to wait for another thread within 
  5245. the process to end.  A thread can wait for any thread, or for a specific 
  5246. thread, to terminate. 
  5247.  
  5248.  
  5249. ΓòÉΓòÉΓòÉ 4.1.2.7. Getting Thread and Process Information ΓòÉΓòÉΓòÉ
  5250.  
  5251. Version        Functions 
  5252.  
  5253. 16-bit         DosGetEnv, DosGetInfoSeg, DosGetPrty, DosGetPID, DosGetPPID 
  5254.  
  5255. 32-bit         DosGetInfoBlocks, DosQuerySysInfo 
  5256.  
  5257. Information services have changed slightly in the 32-bit version of the 
  5258. operating system.  Values that are constants are all accessible with 
  5259. DosQuerySysInfo.  Other information functions (such as DosGetDateTime) must be 
  5260. used to retrieve dynamic, system-wide information. 
  5261.  
  5262. Per-thread and per-process information is now retrieved through 
  5263. DosGetInfoBlocks, which returns the address of the Thread Information Block 
  5264. (TIB) of the current thread and the address of the Process Information Block 
  5265. (PIB) of the current process. 
  5266.  
  5267. Several items of the TIB are kept in a read/write area of the process address 
  5268. space.  Each data item is a doubleword field that describes the current thread 
  5269. as follows: 
  5270.  
  5271.  Exception List Chain     /* Current-thread identifier                 */
  5272.  Base ESP                 /* Address of the base of the thread stack   */
  5273.  Thread Stack Limit       /* Address of the end of the thread stack    */
  5274.  
  5275.  System-specific Thread   /* Address of a thread information block     */
  5276.  Information              /* that is specific to an operating system   */
  5277.  
  5278.  Version                  /* Version number of the TIB                 */
  5279.  User Data                /* Unused field that is available for use by */
  5280.                           /* the application                           */
  5281.  
  5282. The system-specific TIB contains the following doubleword fields: 
  5283.  
  5284.  TID                      /* Current-thread identifier                 */
  5285.  Priority                 /* Current-thread priority                   */
  5286.  Version                  /* Version number of the system-specific TIB */
  5287.  
  5288.  Must Complete            /* The low-order word maintains a count for  */
  5289.                           /* DosEnterMustComplete and                  */
  5290.                           /* DosExitMustComplete.  The high-order      */
  5291.                           /* word is reserved                          */
  5292.  
  5293. Several items of the PIB are kept in a read/write area of the process address 
  5294. space.  Each data item is a doubleword field that describes the current process 
  5295. as follows: 
  5296.  
  5297.  PID                    /* Current-process identifier                */
  5298.  PPID                   /* Parent-process identifier                 */
  5299.  Module Handle          /* Module handle of the current process      */
  5300.  Command Line           /* Address of the command line               */
  5301.  Environment            /* Address of the environment block          */
  5302.  Status                 /* Status of the current process             */
  5303.  Type                   /* Type of the current process               */
  5304.  
  5305. Information that is specified for the current thread refers to the thread 
  5306. calling DosGetInfoBlocks.  Process information is shared by all threads in a 
  5307. process. 
  5308.  
  5309. This information replaces the function of DosGetPrty, DosGetPID, and 
  5310. DosGetPPID, and part of DosGetInfoSeg. 
  5311.  
  5312. The following example determines the process identifier, parent-process 
  5313. identifier, thread priority, and current hour. 
  5314.  
  5315.  16-Bit:
  5316.  
  5317.  PIDINFO pidi;
  5318.  SEL selGlobalSeg, selLocalSeg;
  5319.  PGINFOSEG pgis;
  5320.  PID pid, pidParent;
  5321.  USHORT usPriority;
  5322.  UCHAR uchHour;
  5323.  
  5324.  DosGetPID(&pidi);
  5325.  pid = pidi.pid;
  5326.  pidParent = pidi.pidParent;
  5327.  
  5328.  DosGetPrty(PRTYS_THREAD, &usPriority, 0);
  5329.  
  5330.  DosGetInfoSeg(&selGlobalSeg, &selLocalSeg);
  5331.  pgis = MAKEPGINFOSEG(selGlobalSeg);
  5332.  uchHour = pgis->hour;
  5333.  
  5334.  32-Bit:
  5335.  
  5336.  DATETIME dateTime;
  5337.  PTIB ptib;
  5338.  PPIB ppib;
  5339.  PID pid, pidParent;
  5340.  USHORT usPriority;
  5341.  UCHAR uchHour;
  5342.  
  5343.  DosGetInfoBlocks(&ptib, &ppib);
  5344.  pid = ppib->pib_ulpid;
  5345.  pidParent = ppib->pib_ulppid;
  5346.  usPriority = ptib->tib_ulpri;
  5347.  
  5348.  DosGetDateTime(&dateTime);
  5349.  uchHour = dateTime.hours;
  5350.  
  5351. Getting Thread and Process Information 
  5352.  
  5353.  
  5354. ΓòÉΓòÉΓòÉ 4.1.2.8. Starting Programs ΓòÉΓòÉΓòÉ
  5355.  
  5356. Version        Functions 
  5357.  
  5358. 16-bit         DosExecPgm 
  5359.  
  5360. 32-bit         DosExecPgm 
  5361.  
  5362. These functions perform the same action. 
  5363.  
  5364.  
  5365. ΓòÉΓòÉΓòÉ 4.1.2.9. Debugging Programs ΓòÉΓòÉΓòÉ
  5366.  
  5367. Version        Functions 
  5368.  
  5369. 16-bit         DosPtrace 
  5370.  
  5371. 32-bit         DosDebug 
  5372.  
  5373. The DosDebug function is new for the 32-bit version of the operating system. 
  5374. It provides 32-bit debugger support for 16-bit and 32-bit applications.  The 
  5375. DosPtrace function is retained to provide debugging support for 16-bit 
  5376. debuggers.  Due to the equivalencies between DosPtrace and DosDebug, DosPtrace 
  5377. can be implemented on top of DosDebug through a thunk layer.  This thunk layer 
  5378. is needed to convert between DosPtrace 16:16 addresses and DosDebug 0:32 
  5379. addresses, between DosPtrace word fields and DosDebug doubleword fields, and so 
  5380. on. 
  5381.  
  5382.  
  5383. ΓòÉΓòÉΓòÉ 4.1.3. 16-Bit Functions with No 32-Bit Counterparts ΓòÉΓòÉΓòÉ
  5384.  
  5385. The DosR2StackRealloc and DosCallBack functions exist in previous versions of 
  5386. OS/2 2.0 because of the three-ring nature of the 80286 privilege levels.  The 
  5387. linear addressing method used in OS/2 2.0 supports a two-level 
  5388. (supervisor/user) privilege mechanism, which makes these functions unnecessary. 
  5389.  
  5390.  
  5391. ΓòÉΓòÉΓòÉ 4.1.4. Semaphores ΓòÉΓòÉΓòÉ
  5392.  
  5393. The 16-bit semaphore functions have the following shortcomings: 
  5394.  
  5395. o There is a possibility of missing clear events. 
  5396.  
  5397. o The individual semaphore state is not adequately cleared by the system at 
  5398.   process or thread termination. 
  5399.  
  5400. o The system limit on the total number of semaphores is restrictive. 
  5401.  
  5402. o Thread termination cannot be detected in a critical section, increasing the 
  5403.   possibility that resources can be left in an unresolved state. 
  5404.  
  5405. o There is the possibility of a spurious wake-up.  A spurious wake-up results 
  5406.   when code that has suspended execution (due to a semaphore) resumes execution 
  5407.   before the semaphore is freed by another thread or process. 
  5408.  
  5409. o Semaphore usage is overloaded, because the same semaphore mechanism is used 
  5410.   for both signaling and mutual exclusion. 
  5411.  
  5412. o The ability of any thread to determine the state of a semaphore, other than 
  5413.   the thread that owns the semaphore, is limited. 
  5414.  
  5415. The 32-bit versions of the semaphore functions address these problems and 
  5416. attempt to provide the speed of the former fast-safe RAM semaphores.  (Recall 
  5417. that for fast-safe RAM, serialization is controlled by the system and contained 
  5418. in application memory). None of the 32-bit semaphore functions are compatible 
  5419. with the 16-bit versions. 
  5420.  
  5421. There are two classes of 32-bit semaphores:  private and shared.  A process can 
  5422. have up to 64K of private semaphores, available only to threads within that 
  5423. process, and also can access up to 64K of shared semaphores, available to all 
  5424. processes in the system.  In addition, there are three types of 32-bit 
  5425. semaphores: mutex, event, and muxwait. 
  5426.  
  5427. Type           Description 
  5428.  
  5429. Mutex          (Mutual Exclusion):  Used by several threads within a process, 
  5430.                or by several processes, to protect access to a critical region. 
  5431.                A typical use would be to prevent more than one thread at a time 
  5432.                from updating a file on disk. 
  5433.  
  5434. Event          Provides a signaling mechanism among threads or among several 
  5435.                processes.  A typical use would be to manage shared memory: 
  5436.                Process 1 writes to the shared region, then uses an event 
  5437.                semaphore to signal processes 2 and 3 that they can access the 
  5438.                shared data. 
  5439.  
  5440. Muxwait        (Multiple Wait):  Enables a thread to wait on several event or 
  5441.                mutex semaphores simultaneously.  It is a compound semaphore 
  5442.                that consists of up to 64 event semaphores or mutex semaphores 
  5443.                (the two types cannot be mixed).  A typical use would be when a 
  5444.                thread requires access to several shared regions of memory at 
  5445.                once.  The system blocks the thread until the thread acquires 
  5446.                ownership of all mutex semaphores protecting the shared regions. 
  5447.                The thread can then access the regions. Meanwhile, the system 
  5448.                prevents access by other threads that are using the muxwait 
  5449.                semaphore. 
  5450.  
  5451.  
  5452. ΓòÉΓòÉΓòÉ 4.1.4.1. Using Semaphores ΓòÉΓòÉΓòÉ
  5453.  
  5454. Several general rules apply when using the new 32-bit semaphore functions. 
  5455.  
  5456. Semaphores can be created as either named or unnamed entities.  If the name 
  5457. parameter is other than NULL, it must be a name of the form \sem32\name, where 
  5458. name adheres to the file-system naming conventions.  No record of the semaphore 
  5459. is actually kept on the disk; when the last process closes a named shared 
  5460. semaphore, the semaphore is removed from the system.  A named semaphore is 
  5461. always shared (available to other processes that know the name).  If the name 
  5462. field is NULL, an unnamed semaphore is created.  Unnamed semaphores can be 
  5463. either private to a process or shared among processes, depending on whether the 
  5464. DC_SEM_SHARED flag is set when the semaphore is created. Semaphores intended 
  5465. for use solely among threads of the same process should be made private. 
  5466.  
  5467. The sequence for using shared semaphores among processes is as follows: 
  5468.  
  5469.  1. Process 1 calls the appropriate function to create the semaphore, 
  5470.     initializing it through the creation parameters. 
  5471.  
  5472.  2. Processes 2 through n use the same name (named semaphores) or receive the 
  5473.     same semaphore handle (shared unnamed semaphores), and each calls the 
  5474.     appropriate function to obtain access to the semaphore. 
  5475.  
  5476.  3. The processes use the semaphore. 
  5477.  
  5478.  4. Each process calls the appropriate closing function (DosCloseMutexSem, 
  5479.     DosCloseEventSem, DosCloseMutexWaitSem) when finished with the semaphore. 
  5480.     The system permits nested Open and Close functions for semaphores, up to 
  5481.     64KB deep (65 536 simultaneous open functions); however, to release a 
  5482.     semaphore from a process, the Close function must be executed as many times 
  5483.     as the Open function was executed.  When all processes have closed the 
  5484.     semaphore, the system frees the associated name (named semaphores) or 
  5485.     handle (unnamed semaphores). 
  5486.  
  5487. If a thread ends while owning a mutex semaphore, future request or query 
  5488. function calls will return the error value, ERROR_SEM_OWNER_DIED.  The mutex 
  5489. semaphore then must be closed, because its use is no longer valid.  If 
  5490. ERROR_SEM_OWNER_DIED was returned from a muxwait semaphore, all semaphores in 
  5491. the group should be queried and those whose owners have ended must be closed. 
  5492. They also should be removed from the muxwait group.  Event semaphores (and 
  5493. muxwait semaphores involving event semaphores) will not receive this error if 
  5494. the process that expected to call DosPostEventSem ends.  Processes waiting for 
  5495. untrustworthy events should therefore use the time-out fields when waiting to 
  5496. periodically re-evaluate the situation.  For example, process 1 waits for an 
  5497. event semaphore that process 2 is supposed to post.  Process 2 may fail to 
  5498. perform the post due to a large number of environment factors.  Therefore 
  5499. process 1 should set a time-out in case process 2 cannot perform its function. 
  5500.  
  5501. The following table summarizes the 16-bit and corresponding 32-bit semaphore 
  5502. functions. 
  5503.  
  5504. 16-Bit to 32-Bit Semaphore Functions 
  5505.  
  5506. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5507. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  5508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5509. ΓöéDosSemClear                   ΓöéN/A                           Γöé
  5510. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5511. ΓöéDosSemRequest                 ΓöéN/A                           Γöé
  5512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5513. ΓöéDosSemSet                     ΓöéN/A                           Γöé
  5514. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5515. ΓöéDosSemSetWait                 ΓöéN/A                           Γöé
  5516. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5517. ΓöéDosSemWait                    ΓöéN/A                           Γöé
  5518. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5519. ΓöéDosMuxSemWait                 ΓöéN/A                           Γöé
  5520. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5521. ΓöéDosCloseSem                   ΓöéN/A                           Γöé
  5522. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5523. ΓöéDosCreateSem                  ΓöéN/A                           Γöé
  5524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5525. ΓöéDosOpenSem                    ΓöéN/A                           Γöé
  5526. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5527. ΓöéDosFSRamSemRequest            ΓöéN/A                           Γöé
  5528. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5529. ΓöéDosFSRamSemClear              ΓöéN/A                           Γöé
  5530. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5531. ΓöéN/A                           ΓöéDosCreateMutexSem             Γöé
  5532. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5533. ΓöéN/A                           ΓöéDosOpenMutexSem               Γöé
  5534. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5535. ΓöéN/A                           ΓöéDosCloseMutexSem              Γöé
  5536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5537. ΓöéN/A                           ΓöéDosRequestMutexSem            Γöé
  5538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5539. ΓöéN/A                           ΓöéDosReleaseMutexSem            Γöé
  5540. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5541. ΓöéN/A                           ΓöéDosQueryMutexSem              Γöé
  5542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5543. ΓöéN/A                           ΓöéDosCreateEventSem             Γöé
  5544. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5545. ΓöéN/A                           ΓöéDosOpenEventSem               Γöé
  5546. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5547. ΓöéN/A                           ΓöéDosCloseEventSem              Γöé
  5548. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5549. ΓöéN/A                           ΓöéDosResetEventSem              Γöé
  5550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5551. ΓöéN/A                           ΓöéDosPostEventSem               Γöé
  5552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5553. ΓöéN/A                           ΓöéDosWaitEventSem               Γöé
  5554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5555. ΓöéN/A                           ΓöéDosQueryEventSem              Γöé
  5556. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5557. ΓöéN/A                           ΓöéDosCreateMuxWaitSem           Γöé
  5558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5559. ΓöéN/A                           ΓöéDosOpenMuxWaitSem             Γöé
  5560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5561. ΓöéN/A                           ΓöéDosCloseMuxWaitSem            Γöé
  5562. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5563. ΓöéN/A                           ΓöéDosWaitMuxWaitSem             Γöé
  5564. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5565. ΓöéN/A                           ΓöéDosAddMuxWaitSem              Γöé
  5566. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5567. ΓöéN/A                           ΓöéDosDeleteMuxWaitSem           Γöé
  5568. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5569. ΓöéN/A                           ΓöéDosQueryMuxWaitSem            Γöé
  5570. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5571.  
  5572.  
  5573. ΓòÉΓòÉΓòÉ 4.1.4.2. Signaling Events with Semaphores ΓòÉΓòÉΓòÉ
  5574.  
  5575. Version        Functions 
  5576.  
  5577. 32-bit         DosCreateEventSem, DosOpenEventSem, DosCloseEventSem, 
  5578.                DosResetEventSem, DosPostEventSem, DosWaitEventSem, 
  5579.                DosQueryEventSem 
  5580.  
  5581. Event semaphores have two basic states-posted and reset.  The DosPostEventSem 
  5582. function posts the semaphore if it is not posted, and increments the number of 
  5583. postings (until the number reaches the maximum).  All threads that have used 
  5584. DosWaitEventSem on this semaphore are tagged for wake-up (to resume execution). 
  5585.  
  5586. The DosResetEventSem function resets the semaphore, if it is not already reset, 
  5587. and blocks all threads that use the DosWaitEventSem function afterwards.  The 
  5588. DosQueryEventSem function returns the current number of postings to the 
  5589. semaphore.  A count of 0 indicates that the semaphore is in the reset state, 
  5590. and threads that wait on the semaphore are blocked. 
  5591.  
  5592. The following examples demonstrate the use of event semaphores.  A single 
  5593. process (process 1) writes to a shared memory region.  Several processes (2 
  5594. through n) then read the data for further processing. 
  5595.  
  5596.  Process 1:
  5597.  
  5598.  HSYSSEM hssm;
  5599.  
  5600.  DosCreateSem(CSEM_PRIVATE, &hssm, "\\sem\\mysignal");
  5601.  
  5602.  /* Set the semaphore. */
  5603.  
  5604.  DosSemSet(hssm);
  5605.  
  5606.  /* Fill shared memory region with data. */
  5607.  
  5608.  /* Signal that data is ready. */
  5609.  
  5610.  DosSemClear(hssm);
  5611.  
  5612.  /* Program continues. Other processes read data and finish with the
  5613.   * event semaphore.*/
  5614.  
  5615.  DosCloseSem(hssm);
  5616.  
  5617.  All other processes:
  5618.  
  5619.  HSYSSEM hssm;
  5620.  
  5621.  DosOpenSem(&hssm, "\\sem\\mysignal");
  5622.  DosSemWait(hssm, SEM_INDEFINITE_WAIT);
  5623.  
  5624.  /* Use shared memory data now. */
  5625.  
  5626.  DosCloseSem(hssm);
  5627.  
  5628. Using Event Semaphores-16-Bit Version 
  5629.  
  5630.  Process 1:
  5631.  
  5632.  HEV hev = 0;    /* handle to event semaphore */
  5633.  
  5634.  DosCreateEventSem("\\sem32\\mysignal", &hev, 0, FALSE);
  5635.  
  5636.  /* Fill shared memory region with data. */
  5637.     .
  5638.     .
  5639.  DosPostEventSem(hev);
  5640.  
  5641.  /*
  5642.   * Program continues. Other processes read data and finish with
  5643.   * the event semaphore.
  5644.   */
  5645.  
  5646.  DosCloseEventSem(hev);
  5647.  
  5648.  All other processes:
  5649.  
  5650.  /* Handle to event semaphore */
  5651.  HEV hev = 0;
  5652.  
  5653.  DosOpenEventSem("\\sem32\\mysignal", &hev);
  5654.  DosWaitEventSem(hev, SEM_INDEFINITE_WAIT);
  5655.  
  5656.  /* Use shared memory data now. */
  5657.     .
  5658.     .
  5659.  DosCloseEventSem (hev);
  5660.  
  5661. Using Event Semaphores-32-Bit Version 
  5662.  
  5663.  
  5664. ΓòÉΓòÉΓòÉ 4.1.4.3. Using Event Semaphores Between 16- and 32-bit Code ΓòÉΓòÉΓòÉ
  5665.  
  5666. New 32-bit applications can pass a 32-bit event semaphore handle to 16-bit 
  5667. code.  This handle can then be used by the 16-bit DosSemSet and DosSemClear 
  5668. functions.  If DosSemSet is passed a 32-bit semaphore handle, it will act 
  5669. exactly as if DosResetEventSem was called with the same handle.  If DosSemClear 
  5670. is passed a 32-bit semaphore handle, it will act exactly as if DosPostEventSem 
  5671. was called with the same handle. 
  5672.  
  5673. o Dos16SemClear will do a Dos32PostEventSem 
  5674. o Dos16SemSet will do a Dos32ResetSem 
  5675.  
  5676.  
  5677. ΓòÉΓòÉΓòÉ 4.1.4.4. Using Semaphores for Mutual Exclusion ΓòÉΓòÉΓòÉ
  5678.  
  5679. Version        Functions 
  5680.  
  5681. 32-bit         DosCreateMutexSem, DosOpenMutexSem, DosCloseMutexSem, 
  5682.                DosRequestMutexSem, DosReleaseMutexSem, DosQueryMutexSem 
  5683.  
  5684. Mutual exclusion (mutex) semaphores protect critical sections of code from 
  5685. being executed by more than one thread at a time.  The threads containing these 
  5686. critical sections of code can belong to the same process (a private semaphore), 
  5687. or to separate processes (a shared semaphore).  Each process must call 
  5688. DosRequestMutexSem before beginning the critical section.  If this function 
  5689. does not return an error, the caller has ownership of the semaphore and can 
  5690. proceed to execute the critical section.  When execution of the section is 
  5691. complete, the same thread must call DosReleaseMutexSem to give up ownership. 
  5692. The system will queue requests and transfer ownership to the next waiting 
  5693. thread when the semaphore is released.  The semaphore also can be set when it 
  5694. is created, making the operation atomic and therefore completely reliable; with 
  5695. this approach, no other thread will run until the creating thread releases 
  5696. ownership. 
  5697.  
  5698. The following examples demonstrate the use of mutex semaphores.  Two processes 
  5699. that write to a single, shared region must coordinate their activities so that 
  5700. both are not writing at the same time (to do so would damage the data).  By 
  5701. convention, process 1 creates the semaphore, and process 2 opens it. 
  5702.  
  5703.  
  5704. Using Semaphores for Mutual Exclusion-16-Bit Version
  5705.  
  5706.  Process 1:
  5707.  
  5708.  /* Allocate shared memory for the semaphore structure. */
  5709.  
  5710.  SEL selShared;
  5711.  PDOSFSRSEM pdosfsrs;
  5712.  
  5713.  DosAllocShrSeg(sizeof(DOSFSRSEM), "\\sharemem\\myshrseg",
  5714.      &selShared);
  5715.  pdosfsrs = MAKEP(selShared, 0);
  5716.  pdosfsrs->cb = sizeof(DOSFSRSEM);
  5717.  pdosfsrs->tid = pdosfsrs->pid = 0;
  5718.  pdosfsrs->client = pdosfsrs->cUsage = 0;
  5719.  pdosfsrs->sem = 0L;
  5720.  
  5721.  /* Execute other code. */
  5722.      .
  5723.      .
  5724.  /* Critical section begins here. Use this function to block until
  5725.     semaphore is available. */
  5726.  
  5727.  DosFSRamSemRequest(pdosfsrs, SEM_INDEFINITE_WAIT);
  5728.  
  5729.  /* Read or write the shared data. */
  5730.      .
  5731.  /* Done with critical code. */
  5732.  
  5733.  DosFSRamSemClear(pdosfsrs);
  5734.  
  5735.  /* Execute rest of program. At termination, free shared memory. */
  5736.  
  5737.  DosFreeSeg(selShared);
  5738.  
  5739.  Process 2:
  5740.  
  5741.  /* Allocate shared memory for the semaphore structure. */
  5742.  
  5743.  SEL selShared;
  5744.  PDOSFSRSEM pdosfsrs;
  5745.  
  5746.  DosGetShrSeg("\\sharemem\\myshrseg", &selShared);
  5747.  pdosfsrs = MAKEP(selShared, 0);
  5748.  
  5749.  /* Execute other code. */
  5750.      .
  5751.  /* Critical section begins here. */
  5752.  
  5753.  DosFSRamSemRequest(pdosfsrs, SEM_INDEFINITE_WAIT);
  5754.  
  5755.  /* Read or write the shared data. */
  5756.      .
  5757.  /* Done with critical code. */
  5758.  
  5759.  DosFSRamSemClear(pdosfsrs);
  5760.  /* Execute other code. */
  5761.  .
  5762.  /* When finished  executing critical code, free shared memory. */
  5763.  
  5764.  DosFreeSeg(selShared);
  5765.  
  5766.  
  5767. UsingSemaphoresforMutualExclusion - 32 - BitVersion
  5768.  
  5769. Process 1:
  5770.  
  5771.  HMTX hmtx = 0;    /* handle to event semaphore */
  5772.  
  5773.  DosCreateMutexSem ("\\sem32\\mymutex", &hmtx, 0, FALSE);
  5774.  
  5775.  /* Execute other code. */
  5776.      .
  5777.  /* Critical section begins here. */
  5778.  
  5779.  /* Block until available         */
  5780.  
  5781.  DosRequestMutexSem(hmtx, SEM_INDEFINITE_WAIT);
  5782.  
  5783.  /* Read or write the shared data. */
  5784.      .
  5785.  /* Done with critical code. */
  5786.  
  5787.  DosReleaseMutexSem(hmtx);
  5788.  
  5789.  /* Execute rest of program. At termination, close semaphore. */
  5790.  
  5791.  DosCloseMutexSem(hmtx);
  5792.  
  5793.  Process 2:
  5794.  HMTX hmtx = 0;    /* handle to event semaphore */
  5795.  
  5796.  DosOpenMutexSem("\\sem32\\mymutex", &hmtx);
  5797.  
  5798.  /* Execute other code. */
  5799.      .
  5800.  /* Critical section begins here. */
  5801.  
  5802.  /* Block until available         */
  5803.  
  5804.  DosRequestMutexSem(hmtx, SEM_INDEFINITE_WAIT);
  5805.  
  5806.  /* Read or write the shared data. */
  5807.      .
  5808.  /* Done with critical code. */
  5809.  
  5810.  DosReleaseMutexSem(hmtx);
  5811.  
  5812.  /* Execute other code. */
  5813.      .
  5814.  /* When finished executing critical code, close the semaphore. */
  5815.  
  5816.  DosCloseMutexSem(hmtx);
  5817.  
  5818.  
  5819. ΓòÉΓòÉΓòÉ 4.1.4.5. Using Semaphores for Multiple Waiting ΓòÉΓòÉΓòÉ
  5820.  
  5821. Version        Functions 
  5822.  
  5823. 32-bit         DosCreateMuxWaitSem, DosOpenMuxWaitSem, DosCloseMuxWaitSem, 
  5824.                DosWaitMuxWaitSem, DosAddMuxWaitSem, DosDeleteMuxWaitSem, 
  5825.                DosQueryMuxWaitSem 
  5826.  
  5827. The multiple-wait (muxwait) functions enable an application to wait on more 
  5828. than one semaphore at a time.  A typical use would be in a process that 
  5829. requires several resources in order to perform its work, and that no changes 
  5830. occur to those resources while they are in its possession. This is a 
  5831. multiple-wait on mutex semaphores.  A group of event semaphores also can be 
  5832. waited on to enable a thread or process to be activated whenever an particular 
  5833. event occurs (for instance, a thread monitoring three sources of input might 
  5834. remain inactive until one of the sources receives input).  The muxwait 
  5835. functions allow waiting for all of the indicated semaphores as well.  Note that 
  5836. mutex and event semaphores cannot be mixed in a muxwait semaphore.  Also, if 
  5837. any of the individual semaphores are private to a process, the muxwait 
  5838. semaphore also must be private to that process. 
  5839.  
  5840. The following example shows a thread requesting simultaneous ownership of 
  5841. several resources.  This example uses unnamed, private semaphores; they also 
  5842. could be shared or named-shared semaphores. 
  5843.  
  5844.  
  5845. Using Semaphores for Multiple Waiting
  5846.  
  5847.  HMUX hmux;    /* handle to multiple-wait semaphore                     */
  5848.  ULONG ulUser; /* only (WAIT_ANY) or last (WAIT_ALL) semaphore released */
  5849.  SEMRECORD apsr[5]; /* array of mutex semaphores created elsewhere
  5850.                      * and copied to aSemRec
  5851.                      */
  5852.  
  5853.  DosCreateMuxWaitSem((PSZ) NULL, &hmux, 3, apsr, DCMW_WAIT_ALL);
  5854.  DosWaitMuxWaitSem(hmux, SEM_INDEFINITE_WAIT, &ulUser);
  5855.  
  5856.  /*
  5857.   * When this call returns, the other threads using the resources have
  5858.   * all released their mutex semaphores; this thread can now make
  5859.   * simultaneous use of all three, knowing that no other thread is
  5860.   * accessing the data.
  5861.   */
  5862.  
  5863.  /* Critical code is executed. */
  5864.      .
  5865.  
  5866.  /* Mutex semaphores are released when critical section is complete; the
  5867.   * use of a muxwait semaphore does not free the program from releasing
  5868.   * the individual mutex semaphores it represents when the critical section
  5869.   * has passed. */
  5870.  
  5871.  /*  Other code is executed. */
  5872.      .
  5873.  
  5874.  /* Finished with the semaphore for good. */
  5875.  DosCloseMuxWaitSem(hmux);
  5876.  
  5877.  The following code fragment shows a thread waiting for multiple sources of
  5878.  input. The thread will wait for input from any one of three sources.
  5879.  
  5880.  HMUX hmux;    /* handle to multiple-wait semaphore               */
  5881.  ULONG ulUser; /* only (WAIT_ANY) or last (WAIT_ALL) semaphore    */
  5882.                /* that signaled*/
  5883.  
  5884.  SEMRECORD apsr[5]; /* array of event semaphores created          */
  5885.                     /* elsewhere and copied to apsr               */
  5886.  
  5887.  
  5888.  DosCreateMuxWaitSem((PSZ) NULL, &hmux, 3, apsr, DCMW_WAIT_ANY);
  5889.  
  5890.  /* When this call returns, at least one of the input sources is ready. */
  5891.  
  5892.  DosWaitMuxWaitSem(hmux, SEM_INDEFINITE_WAIT, &ulUser);
  5893.  
  5894.  /* Thread examines ulUser to determine which input source caused the
  5895.   * wake up. (Alternatively, each event semaphore in the group can be
  5896.   * polled with the DosQueryEventSem function using a time-out of 0.)*/
  5897.  
  5898.  /* Thread now processes the input from the ready source. */
  5899.      .
  5900.  
  5901.  /* Finished with the semaphore. */
  5902.  
  5903.  DosCloseMuxWaitSem(hmux);
  5904.  
  5905.  
  5906. ΓòÉΓòÉΓòÉ 4.1.5. Unnamed Pipes ΓòÉΓòÉΓòÉ
  5907.  
  5908. The 16-bit function, DosMakePipe, and its corresponding 32-bit function, 
  5909. DosCreatePipe, perform the same action.  In the 16-bit version of the operating 
  5910. system, it was suggested that the maximum size of the data passed through the 
  5911. pipe should be 64KB.  This was based on the segment size maximum and the 
  5912. performance overhead of using a larger data size. This size restriction is 
  5913. removed in the 32-bit version of the operating system. 
  5914.  
  5915.  
  5916. ΓòÉΓòÉΓòÉ 4.1.6. Named Pipes ΓòÉΓòÉΓòÉ
  5917.  
  5918. Named-pipe functions, which are listed in the following table, perform the same 
  5919. actions.  Some of the 32-bit names are different.  Please note that there are 
  5920. no equivalent 32-bit functions for DosRawReadNmPipe and DosRawWriteNmPipe. 
  5921.  
  5922. 16-Bit to 32-Bit Named-Pipe Functions 
  5923.  
  5924. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5925. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  5926. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5927. ΓöéDosCallNmPipe                 ΓöéDosCallNPipe                  Γöé
  5928. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5929. ΓöéDosConnectNmPipe              ΓöéDosConnectNPipe               Γöé
  5930. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5931. ΓöéDosDisConnectNmPipe           ΓöéDosDisConnectNPipe            Γöé
  5932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5933. ΓöéDosMakeNmPipe                 ΓöéDosCreateNPipe                Γöé
  5934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5935. ΓöéDosPeekNmPipe                 ΓöéDosPeekNPipe                  Γöé
  5936. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5937. ΓöéDosQNmPHandState              ΓöéDosQueryNPHState              Γöé
  5938. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5939. ΓöéDosQNmPipeInfo                ΓöéDosQueryNPipeInfo             Γöé
  5940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5941. ΓöéDosQNmPipeSemState            ΓöéDosQueryNPipeSemState         Γöé
  5942. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5943. ΓöéDosRawReadNmPipe              ΓöéN/A                           Γöé
  5944. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5945. ΓöéDosRawWriteNmPipe             ΓöéN/A                           Γöé
  5946. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5947. ΓöéDosSetNmPHandInfo             ΓöéDosSetNPHState                Γöé
  5948. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5949. ΓöéDosSetNmPipeSem               ΓöéDosSetNPipeSem                Γöé
  5950. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5951. ΓöéDosTransactNmPipe             ΓöéDosTransactNPipe              Γöé
  5952. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5953. ΓöéDosWaitNmPipe                 ΓöéDosWaitNPipe                  Γöé
  5954. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5955.  
  5956.  
  5957. ΓòÉΓòÉΓòÉ 4.1.7. Queues ΓòÉΓòÉΓòÉ
  5958.  
  5959. The queue functions perform the same actions in both the 16-bit and 32-bit 
  5960. versions of the operating system.  However, be aware of the following: 
  5961.  
  5962. o Although both the 16-bit and 32-bit versions of the functions are 
  5963.   functionally similar, they do not produce compatible system resources; that 
  5964.   is, you cannot create a 16-bit queue and write to it by using the 32-bit 
  5965.   DosWriteQueue function. This applies between processes as well. 
  5966.  
  5967. o Memory allocation in the 32-bit version of the operating system must be made 
  5968.   with the 32-bit linear functions.  DosAllocSharedMem must be used to allocate 
  5969.   space for messages placed in the queue, rather than the segmented equivalent. 
  5970.  
  5971. o If a NoWait of 1 is used when reading (removing data) or peeking (determining 
  5972.   the data contents without removing the data) a queue, the associated 
  5973.   semaphore should be an event semaphore.  A NoWait of 1 tells the calling 
  5974.   function to return if the queue has not data, rather than waiting for the 
  5975.   queue to receive data before returning. In addition, if threads in other 
  5976.   processes will write to the queue, the semaphore should be shared (either 
  5977.   named or unnamed) and must be opened before the writing threads use 
  5978.   DosWriteQueue.  Typically, you will use this semaphore as part of a muxwait 
  5979.   semaphore to be able to respond to any of several input sources (if the 
  5980.   thread is waiting for something to appear in the queue, it should use a 
  5981.   NoWait of 0). 
  5982.  
  5983. The following table lists the queue functions. 
  5984.  
  5985. 16-Bit to 32-Bit Queue Functions 
  5986.  
  5987. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5988. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  5989. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5990. ΓöéDosCreateQueue                ΓöéDosCreateQueue                Γöé
  5991. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5992. ΓöéDosOpenQueue                  ΓöéDosOpenQueue                  Γöé
  5993. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5994. ΓöéDosCloseQueue                 ΓöéDosCloseQueue                 Γöé
  5995. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5996. ΓöéDosPeekQueue                  ΓöéDosPeekQueue                  Γöé
  5997. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5998. ΓöéDosPurgeQueue                 ΓöéDosPurgeQueue                 Γöé
  5999. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6000. ΓöéDosQueryQueue                 ΓöéDosQueryQueue                 Γöé
  6001. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6002. ΓöéDosReadQueue                  ΓöéDosReadQueue                  Γöé
  6003. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6004. ΓöéDosWriteQueue                 ΓöéDosWriteQueue                 Γöé
  6005. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6006.  
  6007.  
  6008. ΓòÉΓòÉΓòÉ 4.1.8. Timers ΓòÉΓòÉΓòÉ
  6009.  
  6010. The timer functions provide time and date access, suspend threads for a given 
  6011. time interval, and run asynchronous and interval timers.  Changes to these 
  6012. functions are minor, resulting primarily from changes to the semaphore 
  6013. functions.  Timer functions are listed in the following table. 
  6014.  
  6015. 16-Bit to 32-Bit Timer Functions 
  6016.  
  6017. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6018. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6019. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6020. ΓöéDosGetDateTime                ΓöéDosGetDateTime                Γöé
  6021. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6022. ΓöéDosSetDateTime                ΓöéDosSetDateTime                Γöé
  6023. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6024. ΓöéDosSleep                      ΓöéDosSleep                      Γöé
  6025. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6026. ΓöéDosTimerAsync                 ΓöéDosAsyncTimer                 Γöé
  6027. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6028. ΓöéDosTimerStart                 ΓöéDosStartTimer                 Γöé
  6029. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6030. ΓöéDosTimerStop                  ΓöéDosStopTimer                  Γöé
  6031. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6032.  
  6033. 16-bit         DosTimerAsync 
  6034.  
  6035. 32-bit         DosAsyncTimer 
  6036.  
  6037. These functions perform the same action.  In the 32-bit version of the 
  6038. operating system, an event semaphore must be reset before its handle is passed 
  6039. to a timer function.  When the timer expires, it will post the event semaphore. 
  6040. If the timer is to be used again, the semaphore must be reset first.  The 
  6041. semaphore can be shared or private. 
  6042.  
  6043.  
  6044. ΓòÉΓòÉΓòÉ 4.1.9. Dynamic Linking ΓòÉΓòÉΓòÉ
  6045.  
  6046. The 32-bit functions operate in a way that is consistent with the 16-bit 
  6047. versions.  The 16-bit functions, DosGetMachineMode, DosGetVersion, and 
  6048. DosGetEnv have no 32-bit equivalents; these functions are unnecessary, because 
  6049. the 32-bit version of the operating system has no family application 
  6050. programming interface (FAPI).  The environment information is in the thread 
  6051. information block, and the version numbers are accessible through 
  6052. DosQuerySysInfo. The following table lists the 16-bit and 32-bit 
  6053. dynamic-linking functions. 
  6054.  
  6055. 16-Bit to 32-Bit Dynamic-Linking Functions 
  6056.  
  6057. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6058. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6059. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6060. ΓöéDosGetResource2               ΓöéDosGetResource                Γöé
  6061. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6062. ΓöéDosFreeModule                 ΓöéDosFreeModule                 Γöé
  6063. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6064. ΓöéDosFreeResource               ΓöéDosFreeResource               Γöé
  6065. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6066. ΓöéDosLoadModule                 ΓöéDosLoadModule                 Γöé
  6067. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6068. ΓöéDosGetProcAddr                ΓöéDosQueryProcAddr              Γöé
  6069. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6070. ΓöéN/A                           ΓöéDosQueryProcType              Γöé
  6071. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6072. ΓöéDosGetModHandle               ΓöéDosQueryModuleHandle          Γöé
  6073. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6074. ΓöéDosGetModName                 ΓöéDosQueryModuleName            Γöé
  6075. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6076. ΓöéDosQAppType                   ΓöéDosQueryAppType               Γöé
  6077. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6078. ΓöéN/A                           ΓöéDosQueryResourceSize          Γöé
  6079. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6080. ΓöéDosGetMachineMode             ΓöéN/A                           Γöé
  6081. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6082. ΓöéBadDynLink                    ΓöéN/A                           Γöé
  6083. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6084. ΓöéDosGetVersion                 ΓöéN/A                           Γöé
  6085. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6086. ΓöéDosGetEnv                     ΓöéN/A                           Γöé
  6087. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6088.  
  6089. 16-bit         DosGetResource2, DosFreeResource 
  6090.  
  6091. 32-bit         DosGetResource, DosFreeResource 
  6092.  
  6093. The 32-bit version of the operating system uses resources in the same way as 
  6094. the 16-bit version of the system.  The paged version of DosGetResource will 
  6095. return a pointer to the read-only memory that represents the resource, just as 
  6096. DosGetResource2 did.  In the first 16-bit version of the system, resources were 
  6097. stored in individual segments that could be freed with DosFreeSeg.  In the 
  6098. second 16-bit version of the system, resources are allocated with 
  6099. DosGetResource2, which will pack several resources into one segment, and are 
  6100. freed by using DosFreeResource.  Under the 32-bit version of the system, 
  6101. resources are allocated with DosGetResource, which returns a 32-bit pointer to 
  6102. the resource.  This pointer can be freed with DosFreeResource. 
  6103.  
  6104. Note that the system will pack multiple resources into the same pages of memory 
  6105. and mark the access for those pages as PAG_READ | PAG_COMMIT. 
  6106.  
  6107. The following example shows the loading of a resource by a program, a sample 
  6108. use of the resource data, and the eventual discarding of the resource. 
  6109.  
  6110.  16-bit:
  6111.  
  6112.  PSZ pszString;
  6113.  
  6114.  DosGetResource2((HMODULE) NULL, RT_RCDATA, 1, &pszString);
  6115.  ScreenPrint(hwnd, pszString);
  6116.  
  6117.  /* ... */
  6118.  
  6119.  DosFreeResource(pszString);
  6120.  
  6121.  32-bit:
  6122.  
  6123.  PSZ pszString;
  6124.  
  6125.  DosGetResource((HMODULE) NULL, RT_RCDATA, 1, &pszString);
  6126.  ScreenPrint(hwnd, pszString);
  6127.  
  6128.  /* ... */
  6129.  
  6130.  DosFreeResource(pszString);
  6131.  
  6132. Using Resources 
  6133.  
  6134.  
  6135. ΓòÉΓòÉΓòÉ 4.1.10. Device I/O ΓòÉΓòÉΓòÉ
  6136.  
  6137. The DosBeep, DosDevConfig, and DosPhysicalDisk functions have remained 
  6138. basically the same.  The DosCLIAccess and DosPortAccess functions are no longer 
  6139. valid in the 32-bit Version of the operating system.  The DosDevIOCtl and 
  6140. DosDevIOCtl2 functions have been combined into the DosDevIOCtl function. The 
  6141. following table lists device I/O functions. 
  6142.  
  6143. 16-Bit to 32-Bit Device I/O Functions 
  6144.  
  6145. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6146. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6147. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6148. ΓöéDosBeep                       ΓöéDosBeep                       Γöé
  6149. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6150. ΓöéDosCLIAccess                  ΓöéN/A                           Γöé
  6151. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6152. ΓöéDosPortAccess                 ΓöéN/A                           Γöé
  6153. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6154. ΓöéDosDevConfig                  ΓöéDosDevConfig                  Γöé
  6155. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6156. ΓöéDosPhysicalDisk               ΓöéDosPhysicalDisk               Γöé
  6157. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6158. ΓöéDosDevIOCtl, DosDevIOCtl2     ΓöéDosDevIOCtl                   Γöé
  6159. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6160.  
  6161.  
  6162. ΓòÉΓòÉΓòÉ 4.1.11. File Systems ΓòÉΓòÉΓòÉ
  6163.  
  6164. File-system functions were significantly improved in the 16-bit version of the 
  6165. system, with the introduction of installable file systems, the High Performance 
  6166. File System, and extended attributes.  In the 32-bit version of the system, 
  6167. file-system functions are basically the same. One new function has been added: 
  6168. DosCancelLockRequest.  This function permits a process to cancel the lock range 
  6169. request for an outstanding DosSetFileLocks function. The following table lists 
  6170. the file-systems functions. 
  6171.  
  6172. 16-Bit to 32-Bit File-System Functions 
  6173.  
  6174. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6175. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6176. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6177. ΓöéDosBufReset                   ΓöéDosResetBuffer                Γöé
  6178. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6179. ΓöéDosChDir                      ΓöéDosSetCurrentDir              Γöé
  6180. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6181. ΓöéDosChgFilePtr                 ΓöéDosSetFilePtr                 Γöé
  6182. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6183. ΓöéDosClose                      ΓöéDosClose                      Γöé
  6184. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6185. ΓöéDosCopy                       ΓöéDosCopy                       Γöé
  6186. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6187. ΓöéDosDelete                     ΓöéDosDelete                     Γöé
  6188. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6189. ΓöéDosDupHandle                  ΓöéDosDupHandle                  Γöé
  6190. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6191. ΓöéDosEditName                   ΓöéDosEditName                   Γöé
  6192. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6193. ΓöéDosEnumAttribute              ΓöéDosEnumAttribute              Γöé
  6194. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6195. ΓöéDosFileIO                     ΓöéN/A                           Γöé
  6196. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6197. ΓöéDosFileLocks                  ΓöéDosSetFileLocks               Γöé
  6198. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6199. ΓöéDosFindClose                  ΓöéDosFindClose                  Γöé
  6200. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6201. ΓöéDosFindFirst                  ΓöéDosFindFirst                  Γöé
  6202. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6203. ΓöéDosFindNext                   ΓöéDosFindNext                   Γöé
  6204. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6205. ΓöéDosFindNotifyClose            ΓöéN/A                           Γöé
  6206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6207. ΓöéDosFindNotifyFirst            ΓöéN/A                           Γöé
  6208. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6209. ΓöéDosFindNotifyNext             ΓöéN/A                           Γöé
  6210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6211. ΓöéDosFSAttach                   ΓöéDosFSAttach                   Γöé
  6212. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6213. ΓöéDosFSCtl                      ΓöéDosFSCtl                      Γöé
  6214. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6215. ΓöéDosMkDir                      ΓöéDosCreateDir                  Γöé
  6216. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6217. ΓöéDosMove                       ΓöéDosMove                       Γöé
  6218. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6219. ΓöéDosNewSize                    ΓöéDosSetFileSize                Γöé
  6220. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6221. ΓöéDosOpen                       ΓöéDosOpen                       Γöé
  6222. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6223. ΓöéDosQCurDir                    ΓöéDosQueryCurrentDir            Γöé
  6224. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6225. ΓöéDosQCurDisk                   ΓöéDosQueryCurrentDisk           Γöé
  6226. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6227. ΓöéDosQFHandState                ΓöéDosQueryFHState               Γöé
  6228. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6229. ΓöéDosQFileInfo                  ΓöéDosQueryFileInfo              Γöé
  6230. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6231. ΓöéDosQFileMode                  ΓöéN/A                           Γöé
  6232. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6233. ΓöéDosQFSAttach                  ΓöéDosQueryFSAttach              Γöé
  6234. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6235. ΓöéDosQFSInfo                    ΓöéDosQueryFSInfo                Γöé
  6236. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6237. ΓöéDosQHandType                  ΓöéDosQueryHType                 Γöé
  6238. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6239. ΓöéDosQPathInfo                  ΓöéDosQueryPathInfo              Γöé
  6240. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6241. ΓöéDosQSysInfo                   ΓöéDosQuerySysInfo               Γöé
  6242. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6243. ΓöéDosQVerify                    ΓöéDosQueryVerify                Γöé
  6244. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6245. ΓöéDosRead                       ΓöéDosRead                       Γöé
  6246. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6247. ΓöéDosReadAsync                  ΓöéN/A                           Γöé
  6248. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6249. ΓöéDosRmDir                      ΓöéDosDeleteDir                  Γöé
  6250. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6251. ΓöéDosScanEnv                    ΓöéDosScanEnv                    Γöé
  6252. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6253. ΓöéDosSearchPath                 ΓöéDosSearchPath                 Γöé
  6254. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6255. ΓöéDosSelectDisk                 ΓöéDosSetDefaultDisk             Γöé
  6256. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6257. ΓöéDosSetFHandState              ΓöéDosSetFHState                 Γöé
  6258. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6259. ΓöéDosSetFileInfo                ΓöéDosSetFileInfo                Γöé
  6260. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6261. ΓöéDosSetFileMode                ΓöéN/A                           Γöé
  6262. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6263. ΓöéDosSetFsInfo                  ΓöéDosSetFSInfo                  Γöé
  6264. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6265. ΓöéDosSetMaxFH                   ΓöéDosSetMaxFH, DosSetRelMaxFH   Γöé
  6266. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6267. ΓöéDosSetPathInfo                ΓöéDosSetPathInfo                Γöé
  6268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6269. ΓöéDosSetVerify                  ΓöéDosSetVerify                  Γöé
  6270. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6271. ΓöéDosShutDown                   ΓöéDosShutdown                   Γöé
  6272. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6273. ΓöéDosWrite                      ΓöéDosWrite                      Γöé
  6274. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6275. ΓöéDosWriteAsync                 ΓöéN/A                           Γöé
  6276. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6277. ΓöéN/A                           ΓöéDosCancelLockRequest          Γöé
  6278. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6279.  
  6280.  
  6281. ΓòÉΓòÉΓòÉ 4.1.11.1. Searching Directories ΓòÉΓòÉΓòÉ
  6282.  
  6283. Version        Functions 
  6284.  
  6285. 16-bit         DosFindFirst, DosFindNext, DosFindClose 
  6286.  
  6287. 32-bit         DosFindFirst, DosFindNext, DosFindClose 
  6288.  
  6289. In the 16-bit version of the system, the DosFindFirst and DosFindNext functions 
  6290. will return all normal files matching a search string.  (A normal file is one 
  6291. with no attribute bits set.) However, files marked as archived, read-only, 
  6292. system, or hidden, or subdirectories that are to be included in the search, 
  6293. must have, at least, their corresponding attribute bits marked to be returned. 
  6294.  
  6295. The same logic applies for the 32-bit version of the system, but a new flag has 
  6296. been added to exclude normal files from the search.  When this flag is used, 
  6297. only files matching the set of attribute bits selected for the search are 
  6298. returned.  This can improve local and network file efficiency. The following 
  6299. figure shows an example of code used in the 32-bit version of the system to 
  6300. find subdirectories. 
  6301.  
  6302.  
  6303.  ULONG ulSearchCount = 256;
  6304.  HDIR hdir = HDIR_CREATE;
  6305.  BYTE abFileInfo[4096];
  6306.  PFILEFINDBUF pfindbuf;
  6307.  
  6308.  pfindbuf = (PFILEFINDBUF) abFileInfo;
  6309.  
  6310.  DosFindFirst("*",
  6311.                &hdir,
  6312.                0x80 | FILE_DIRECTORY | FILE_HIDDEN | FILE_SYSTEM,
  6313.                pfindbuf,
  6314.                sizeof(abFileInfo),
  6315.                &ulSearchCount,
  6316.                0);
  6317.  
  6318. 32-Bit Code for Finding Directories 
  6319.  
  6320. In addition, the 32-bit version of the system has a new information level 
  6321. available to applications: level 4, "Return All EAs". (EAs refer to extended 
  6322. attributes.)  ResultBuf is undefined on input but on output, it will contain a 
  6323. packed set of records that consist of the attributes record described in level 
  6324. 1, followed by an FEAList (full extended attribute list) structure that 
  6325. contains all the extended-attribute information for the file.  The length field 
  6326. of this FEA list is valid, giving the size of the FEA-list buffer. 
  6327.  
  6328.  
  6329. ΓòÉΓòÉΓòÉ 4.1.11.2. Querying File Mode ΓòÉΓòÉΓòÉ
  6330.  
  6331. Version        Functions 
  6332.  
  6333. 16-bit         DosQFileMode 
  6334.  
  6335. 32-bit         DosQueryFileInfo 
  6336.  
  6337. The attribute information returned by DosQFileMode in the 16-bit version of the 
  6338. system should be obtained by using information level 1. Use level 2 with 
  6339. DosQueryFileInfo in the 32-bit version of the system. 
  6340.  
  6341.  
  6342. ΓòÉΓòÉΓòÉ 4.1.11.3. Querying System Information ΓòÉΓòÉΓòÉ
  6343.  
  6344. Version        Functions 
  6345.  
  6346. 16-bit         DosQSysInfo 
  6347.  
  6348. 32-bit         DosQuerySysInfo 
  6349.  
  6350. In the 32-bit version of the system, a new system constant describing the 
  6351. maximum size of a path-name component has been added.  Applications that 
  6352. hard-coded this value to 255 with the 16-bit version of the system can now 
  6353. request this information from the system.  The system can now change the value 
  6354. without causing the application to change. 
  6355.  
  6356.  
  6357. ΓòÉΓòÉΓòÉ 4.1.11.4. Reading Asynchronously ΓòÉΓòÉΓòÉ
  6358.  
  6359. Version        Functions 
  6360.  
  6361. 16-bit         DosReadAsync 
  6362.  
  6363. 32-bit         No equivalent 
  6364.  
  6365. This function does not exist in the 32-bit version of the system.  An 
  6366. application that cannot afford to be blocked during a read operation should 
  6367. create a separate thread for the reading process and post an event semaphore 
  6368. when the reading is complete.  For example, an application may be holding 
  6369. serialization over a shared resource.  If the application is blocked because of 
  6370. a synchronous read request, all other requestors of the serialization will also 
  6371. be blocked until the I/O is completed.  This could lead to a potentially 
  6372. serious performance degradation. 
  6373.  
  6374.  
  6375. ΓòÉΓòÉΓòÉ 4.1.11.5. Setting the File Mode ΓòÉΓòÉΓòÉ
  6376.  
  6377. Version        Functions 
  6378.  
  6379. 16-bit         DosSetFileMode 
  6380.  
  6381. 32-bit         No equivalent 
  6382.  
  6383. In the 32-bit version of the system, use DosSetFileInfo with information-level 
  6384. 1 to change the file mode. 
  6385.  
  6386.  
  6387. ΓòÉΓòÉΓòÉ 4.1.11.6. Setting Available Number of File Handles ΓòÉΓòÉΓòÉ
  6388.  
  6389. Version        Functions 
  6390.  
  6391. 16-bit         DosSetMaxFH 
  6392.  
  6393. 32-bit         DosSetMaxFH, DosSetRelMaxFH 
  6394.  
  6395. The maximum number of file handles available to a process (and, by default, its 
  6396. child processes) can be set with DosSetMaxFH.  In the 32-bit version of the 
  6397. system, processes can adjust the maximum number in a relative fashion (by 
  6398. incrementing or decrementing the current value regardless of what the current 
  6399. value is), allowing a more natural interface for allocating and deallocating 
  6400. the resource.  Also, by specifying a relative change of zero handles, a process 
  6401. can query the current maximum. 
  6402.  
  6403.  
  6404. ΓòÉΓòÉΓòÉ 4.1.11.7. Writing Asynchronously ΓòÉΓòÉΓòÉ
  6405.  
  6406. Version        Functions 
  6407.  
  6408. 16-bit         DosWriteAsync 
  6409.  
  6410. 32-bit         No equivalent 
  6411.  
  6412. This function does not exit in the 32-bit version of the system.  An 
  6413. application that cannot afford to be blocked during a write operation should 
  6414. create a separate thread for the writing process and post an event semaphore 
  6415. when the writing is complete. 
  6416.  
  6417.  
  6418. ΓòÉΓòÉΓòÉ 4.1.12. Message Retrieval ΓòÉΓòÉΓòÉ
  6419.  
  6420. The following table lists the 16-bit and 32-bit message-retrieval functions. 
  6421.  
  6422. 16-Bit to 32-Bit Message-Retrieval Functions 
  6423.  
  6424. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6425. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6426. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6427. ΓöéDosGetMessage                 ΓöéDosGetMessage                 Γöé
  6428. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6429. ΓöéDosInsMessage                 ΓöéDosInsertMessage              Γöé
  6430. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6431. ΓöéDosPutMessage                 ΓöéDosPutMessage                 Γöé
  6432. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6433. ΓöéN/A                           ΓöéDosQueryMessageCp             Γöé
  6434. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6435.  
  6436.  
  6437. ΓòÉΓòÉΓòÉ 4.1.13. Code-Page Management ΓòÉΓòÉΓòÉ
  6438.  
  6439. The following table lists the 16-bit and 32-bit code-page functions. 
  6440.  
  6441. 16-Bit to 32-Bit Code-Page Management Functions 
  6442.  
  6443. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6444. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6445. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6446. ΓöéDosSetCp                      ΓöéN/A                           Γöé
  6447. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6448. ΓöéDosSetProcCp                  ΓöéDosSetProcessCp               Γöé
  6449. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6450. ΓöéDosGetCp                      ΓöéDosQueryCp                    Γöé
  6451. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6452. ΓöéDosGetCtryInfo                ΓöéDosQueryCtryInfo              Γöé
  6453. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6454. ΓöéDosCaseMap                    ΓöéDosMapCase                    Γöé
  6455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6456. ΓöéDosGetDBCSEv                  ΓöéDosQueryDBCSEnv               Γöé
  6457. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6458. ΓöéDosGetCollate                 ΓöéDosQueryCollate               Γöé
  6459. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6460.  
  6461.  
  6462. ΓòÉΓòÉΓòÉ 4.1.14. Session Management ΓòÉΓòÉΓòÉ
  6463.  
  6464. Sessions are groups of processes that together own a virtual screen.  A virtual 
  6465. screen refers to a physical hardware monitor that is emulated to all types of 
  6466. applications: DOS, VIO, AVIO, and PM.  In general, only full-screen virtual 
  6467. input output (VIO) applications use session management APIs; all PM 
  6468. applications run inside the PM session and do not normally call any session 
  6469. functions. 
  6470.  
  6471. The following table lists the 16-bit and 32-bit session-management functions. 
  6472.  
  6473. 16-Bit to 32-Bit Session-Management Functions 
  6474.  
  6475. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6476. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6477. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6478. ΓöéDosStartSession               ΓöéDosStartSession               Γöé
  6479. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6480. ΓöéDosSetSession                 ΓöéDosSetSession                 Γöé
  6481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6482. ΓöéDosSelectSession              ΓöéDosSelectSession              Γöé
  6483. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6484. ΓöéDosStopSession                ΓöéDosStopSession                Γöé
  6485. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6486. ΓöéDosSMRegisterDD               ΓöéN/A                           Γöé
  6487. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6488.  
  6489.  
  6490. ΓòÉΓòÉΓòÉ 4.1.15. Error Management ΓòÉΓòÉΓòÉ
  6491.  
  6492. A process can use error-management functions to disable hard-error and 
  6493. exception notification to the user,  preferring instead to deal with the 
  6494. errors.  In the event of an error, an application then can ignore the error, 
  6495. recover from the error, and provide a more descriptive indication of error 
  6496. status or a more user-friendly error message.  In this way, the application can 
  6497. have a more detailed understanding of the error than the system and therefore 
  6498. can "fine tune" the correct action in response to the error.  In the 32-bit 
  6499. version of the system, the information is encoded as binary flags (bit 0 is 1 
  6500. to enable hard-error pop-up messages; bit 1 is 1 to enable exception pop-up 
  6501. messages).  In both versions, the default is to enable exception and hard-error 
  6502. pop-up messages. The following table lists the 16-bit and 32-bit 
  6503. error-management functions. 
  6504.  
  6505. 16-bit to 32-bit Error Management Functions 
  6506.  
  6507. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6508. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6509. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6510. ΓöéDosErrClass                   ΓöéDosErrClass                   Γöé
  6511. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6512. ΓöéDosError                      ΓöéDosError                      Γöé
  6513. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6514.  
  6515.  
  6516. ΓòÉΓòÉΓòÉ 4.1.16. Signals ΓòÉΓòÉΓòÉ
  6517.  
  6518. Signals have been implemented into the exception-management architecture. The 
  6519. signals "CTRL+C", "CTRL+BREAK", and "KILLPROCESS" have been defined as signal 
  6520. exceptions. 
  6521.  
  6522. The 16-bit signal functions are DosHoldSignal, DosSetSigHandler, and 
  6523. DosSendSignal.  There are no equivalent 32-bit functions. 
  6524.  
  6525.  
  6526. ΓòÉΓòÉΓòÉ 4.1.17. Exception Management ΓòÉΓòÉΓòÉ
  6527.  
  6528. In the 16-bit version of the operating system, signals are dispatched from a 
  6529. number of sources and are used to interrupt executing processes. These signals 
  6530. include "CTRL+C," "CTRL+BREAK," and "KILLPROCESS." 
  6531.  
  6532. In the 32-bit version of the operating system, signal handling has been merged 
  6533. with exception handling to provide a general, portable, mechanism for handling 
  6534. all such events.  Four new system functions are defined for exception handling 
  6535. on a per-thread basis: 
  6536.  
  6537. o DosRaiseException() 
  6538. o DosSetExceptionHandler() 
  6539. o DosUnsetExceptionHandler() 
  6540. o DosUnwindException() 
  6541.  
  6542. Applications can register their own routines (by using DosSetExceptionHandler) 
  6543. to handle specific types of exceptions, including general protection exceptions 
  6544. that cannot be trapped by applications under previous versions of the operating 
  6545. system. Instead of requiring that exception handlers be written in assembly 
  6546. language (as is the case with the 16-bit version of the operating system), they 
  6547. can now be written in a high-level language, such as C. 
  6548.  
  6549. In the 32-bit version of the operating system, general protection exceptions 
  6550. can be handled within the application.  This allows an application to recover 
  6551. or at least to terminate in an orderly manner. 
  6552.  
  6553. The DosSetSignalExceptionFocus function is used by 32-bit applications to 
  6554. inform the operating system that it is ready to receive signals. However, these 
  6555. signals are dispatched and treated as exceptions. This generalized approach 
  6556. enables exception handlers to be chained, nested, or both.  Exceptions can then 
  6557. be handled by the first exception handler in the chain, or passed to subsequent 
  6558. handlers.  The fact that these exception handlers can be written in a 
  6559. high-level language reduces dependencies on the 80386 architecture, and eases 
  6560. the porting of applications to other operating systems and hardware platforms. 
  6561.  
  6562. The following table lists the 16-bit and 32-bit exception-management functions. 
  6563. There are few corresponding 16-bit exception-management functions. 
  6564.  
  6565. 16-Bit to 32-Bit Exception-Management Functions 
  6566.  
  6567. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6568. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6569. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6570. ΓöéDosSetVec                     ΓöéN/A                           Γöé
  6571. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6572. ΓöéN/A                           ΓöéDosSetExceptionHandler        Γöé
  6573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6574. ΓöéN/A                           ΓöéDosUnsetExceptionHandler      Γöé
  6575. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6576. ΓöéN/A                           ΓöéDosRaiseException             Γöé
  6577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6578. ΓöéN/A                           ΓöéDosUnwindException            Γöé
  6579. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6580. ΓöéN/A                           ΓöéDosSendSignalException        Γöé
  6581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6582. ΓöéN/A                           ΓöéDosSetSignalExceptionFocus    Γöé
  6583. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6584. ΓöéN/A                           ΓöéDosAcknowledgeSignalException Γöé
  6585. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6586. ΓöéN/A                           ΓöéDosEnterMustComplete          Γöé
  6587. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6588. ΓöéN/A                           ΓöéDosExitMustComplete           Γöé
  6589. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6590.  
  6591.  
  6592. ΓòÉΓòÉΓòÉ 4.1.18. VDD Services ΓòÉΓòÉΓòÉ
  6593.  
  6594. The 32-bit version of the system permits protect-mode processes to request 
  6595. services directly from a virtual device driver (VDD).  The new functions shown 
  6596. in the following table support this capability. 
  6597.  
  6598. 32-Bit VDD Services 
  6599.  
  6600. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6601. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6602. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6603. ΓöéN/A                           ΓöéDosOpenVDD                    Γöé
  6604. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6605. ΓöéN/A                           ΓöéDosRequestVDD                 Γöé
  6606. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6607. ΓöéN/A                           ΓöéDosCloseVDD                   Γöé
  6608. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6609.  
  6610.  
  6611. ΓòÉΓòÉΓòÉ 4.1.19. Support for 16-Bit Subsystems ΓòÉΓòÉΓòÉ
  6612.  
  6613. OS/2 2.0 provides support for the following 16-bit subsystems: 
  6614.  
  6615. Vio (video subsystem) 
  6616. Kbd (keyboard subsystem) 
  6617. Mou (mouse subsystem) 
  6618. Mon (device-monitor subsystem) 
  6619. The functions of these subsystems are described in the OS/2 Version 1.3 
  6620. Programming Tools and Information. 
  6621.  
  6622.  
  6623. ΓòÉΓòÉΓòÉ 4.2. Changes to Presentation Manager Services ΓòÉΓòÉΓòÉ
  6624.  
  6625. Changes to PM services can be categorized as new functions and as obsolete 
  6626. 16-bit functions.  Some 16-bit PM functions do not exist in the 32-bit PM 
  6627. function set, but are are still available to 16-bit applications running under 
  6628. the 32-bit version of the system.  New functions are for 32-bit applications 
  6629. only. 
  6630.  
  6631. The 16-bit functions that are not included in the 32-bit PM function set are as 
  6632. follows: 
  6633.  
  6634. o Heap Management 
  6635.  
  6636.    - WinCreateHeap 
  6637.    - WinDestroyHeap 
  6638.    - WinAllocMem 
  6639.    - WinAvailMem 
  6640.    - WinFreeMem 
  6641.    - WinLockHeap 
  6642.    - WinReallocMem 
  6643.  
  6644.      Note:  These functions are replaced by 32-bit memory-management functions. 
  6645.  
  6646. o Installed Program List 
  6647.  
  6648.    - PrfCreateGroup 
  6649.    - PrfDestroyGroup 
  6650.    - PrfAddProgram 
  6651.    - PrfRemoveProgram 
  6652.    - PrfChangeProgram 
  6653.    - PrfQueryProgramCategory 
  6654.    - PrfQueryProgramHandle 
  6655.    - PrfQueryProgramTitles 
  6656.    - PrfQueryDefinition 
  6657.    - WinAddProgram 
  6658.    - WinCreateGroup 
  6659.    - WinInstStartApp 
  6660.    - WinQueryDefinition 
  6661.    - WinQueryProgramTitles 
  6662.    - WinTerminateApp 
  6663.  
  6664.      Note:  These functions are replaced by new workplace functions. 
  6665.  
  6666. o Initialization File 
  6667.  
  6668.    - WinQueryProfileData 
  6669.    - WinQueryProfileInt 
  6670.    - WinQueryProfileSize 
  6671.    - WinQueryProfileString 
  6672.    - WinWriteProfileData 
  6673.    - WinWriteProfileString 
  6674.  
  6675.      Note:  These functions have been replaced by 32-bit profile functions. 
  6676.  
  6677. o Window Locking 
  6678.  
  6679.    - WinLockWindow 
  6680.    - WinLockWindowUpdate 
  6681.    - WinQueryWindowLockCount 
  6682.  
  6683.      Note:  These functions have no corresponding 32-bit versions. 
  6684.  
  6685. o Window Management 
  6686.  
  6687.    - WinRegisterWinDestroy 
  6688.  
  6689.      Note:  This function has been replaced with a hook 
  6690.  
  6691. New 32-bit PM functions are available for printing, application integration and 
  6692. object management, customizing help information, 32-bit migration, standard 
  6693. dialogs, and dragging and dropping objects. In addition, a new set of controls 
  6694. and hooks, as well as helper macros, have been defined. 
  6695.  
  6696.  
  6697. ΓòÉΓòÉΓòÉ 4.2.1. Printing ΓòÉΓòÉΓòÉ
  6698.  
  6699. Applications can control print spooling locally and on a network with Spooler 
  6700. functions.  Spooler functions enable applications to manipulate printer objects 
  6701. (print destinations or printers, print jobs, and print queues).  Applications 
  6702. can add, delete, query, and modify any printer object.  Applications also can 
  6703. interrupt or continue jobs or groups of jobs, and can purge all jobs from a 
  6704. queue. 
  6705.  
  6706. Spooler functions remain the same except for name changes. The following table 
  6707. lists the functions. 
  6708.  
  6709. Version 2.0 Print Functions 
  6710.  
  6711. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6712. Γöé16-Bit Name                   Γöé32-Bit Name                   Γöé
  6713. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6714. ΓöéDosPrintDestControl           ΓöéSplControlDevice              Γöé
  6715. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6716. ΓöéDosPrintDestAdd               ΓöéSplCreateDevice               Γöé
  6717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6718. ΓöéDosPrintDestDel               ΓöéSplDeleteDevice               Γöé
  6719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6720. ΓöéDosPrintDestEnum              ΓöéSplEnumDevice                 Γöé
  6721. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6722. ΓöéDosPrintDestGetInfo           ΓöéSplQueryDevice                Γöé
  6723. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6724. ΓöéDosPrintDestSetInfo           ΓöéSplSetDevice                  Γöé
  6725. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6726. ΓöéDosPrintJobDel                ΓöéSplDeleteJob                  Γöé
  6727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6728. ΓöéDosPrintJobEnum               ΓöéSplEnumJob                    Γöé
  6729. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6730. ΓöéDosPrintJobPause              ΓöéSplHoldJob                    Γöé
  6731. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6732. ΓöéDosPrintJobGetId              ΓöéSplQueryJobId                 Γöé
  6733. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6734. ΓöéDosPrintJobGetInfo            ΓöéSplQueryJob                   Γöé
  6735. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6736. ΓöéDosPrintJobContinue           ΓöéSplReleaseJob                 Γöé
  6737. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6738. ΓöéDosPrintJobSetInfo            ΓöéSplSetJobInfo                 Γöé
  6739. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6740. ΓöéDosPrintQAdd                  ΓöéSplCreateQueue                Γöé
  6741. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6742. ΓöéDosPrintQDel                  ΓöéSplDeleteQueue                Γöé
  6743. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6744. ΓöéDosPrintQEnum                 ΓöéSplEnumQueue                  Γöé
  6745. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6746. ΓöéDosPrintQPause                ΓöéSplHoldQueue                  Γöé
  6747. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6748. ΓöéDosPrintQPurge                ΓöéSplPurgeQueue                 Γöé
  6749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6750. ΓöéDosPrintQGetInfo              ΓöéSplQueryQueue                 Γöé
  6751. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6752. ΓöéDosPrintQContinue             ΓöéSplReleaseQueue               Γöé
  6753. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6754. ΓöéDosPrintQSetInfo              ΓöéSplSetQueue                   Γöé
  6755. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6756. ΓöéDosPrintDriverEnum            ΓöéSplEnumDriver                 Γöé
  6757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6758. ΓöéDosPrintPortEnum              ΓöéSplEnumPort                   Γöé
  6759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6760. ΓöéDosPrintQProcessorEnum        ΓöéSplEnumQueueProcessor         Γöé
  6761. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6762.  
  6763.  
  6764. ΓòÉΓòÉΓòÉ 4.2.2. Workplace ΓòÉΓòÉΓòÉ
  6765.  
  6766. Applications can define objects and what user actions the applications will 
  6767. perform on those objects.  PM provides default handling for objects. The 
  6768. following table lists the new object-management functions. 
  6769.  
  6770. OS/2 2.0 Workplace Functions 
  6771.  
  6772. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6773. ΓöéName                    ΓöéFunction Description                Γöé
  6774. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6775. ΓöéWinCreateObject         ΓöéCreate an object class              Γöé
  6776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6777. ΓöéWinDeregisterObjectClassΓöéRemove a workplace object class     Γöé
  6778. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6779. ΓöéWinDestroyObject        ΓöéDelete a workplace object           Γöé
  6780. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6781. ΓöéWinEnumObjectClasses    ΓöéReturn a list of all workplace      Γöé
  6782. Γöé                        Γöéobject classes that have been       Γöé
  6783. Γöé                        Γöéregistered                          Γöé
  6784. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6785. ΓöéWinFreeFileIcon         ΓöéFree the pointer to an icon         Γöé
  6786. Γöé                        Γöéallocated by WinLoadFileIcon        Γöé
  6787. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6788. ΓöéWinLoadFileIcon         ΓöéReturn a pointer to an icon which isΓöé
  6789. Γöé                        Γöéassociated with the file specified  Γöé
  6790. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6791. ΓöéWinRegisterObjectClass  ΓöéRegister a workplace object class   Γöé
  6792. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6793. ΓöéWinReplaceObjectClass   ΓöéReplace a registered class with     Γöé
  6794. Γöé                        Γöéanother registered class            Γöé
  6795. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6796. ΓöéWinRestoreWindowPos     ΓöéRestore the size and position of theΓöé
  6797. Γöé                        Γöéwindow specified                    Γöé
  6798. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6799. ΓöéWinSetFileIcon          ΓöéSet the icon for the specified file Γöé
  6800. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6801. ΓöéWinSetObjectData        ΓöéSet data on a workplace object      Γöé
  6802. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6803. ΓöéWinShutdownSystem       ΓöéClose down the system               Γöé
  6804. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6805. ΓöéWinStoreWindowPos       ΓöéSave the current size and position  Γöé
  6806. Γöé                        Γöéof the specified window             Γöé
  6807. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6808.  
  6809.  
  6810. ΓòÉΓòÉΓòÉ 4.2.3. Customizing Help Information ΓòÉΓòÉΓòÉ
  6811.  
  6812. The Information Presentation Facility (IPF) manages online, context-sensitive 
  6813. help information.  It displays both text and graphics and provides hypertext 
  6814. links (selectable words or phrases that connect related information) within and 
  6815. between information units.  Enhancements to IPF for the 32-bit version of the 
  6816. system include new tags that provide: 
  6817.  
  6818. o Multiple-viewport support. 
  6819.  
  6820. o Device-independent graphics support through metafiles. A metafile is a 
  6821.   generic name for the definition of the contents of a graphics file. 
  6822.  
  6823. o Horizontal scrolling in help windows. 
  6824.  
  6825. o Multiple text fonts and sizes. 
  6826.  
  6827. o Hypertext links across files. 
  6828.  
  6829. In addition, authors can customize help information with: 
  6830.  
  6831. o Application-controlled viewports: for animation, full-motion video, 
  6832.   simulations, and so on. 
  6833.  
  6834. o Dynamic data formatting (DDF): for displaying dynamic help information. 
  6835.  
  6836. Customized help information is created from a tagged source file that defines 
  6837. each help window (including help, next, previous, search, print, and other 
  6838. buttons), and from application code that is executed by IPF when it processes 
  6839. specific tags in the tagged source file. The following table summarizes the new 
  6840. IPF tags. 
  6841.  
  6842. New IPF Tags 
  6843.  
  6844. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6845. ΓöéName                ΓöéTag Description                         Γöé
  6846. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6847. Γöé:acviewport         ΓöéEnables an application to dynamically   Γöé
  6848. Γöé                    Γöécontrol what is displayed in an IPF     Γöé
  6849. Γöé                    Γöéwindow                                  Γöé
  6850. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6851. Γöé:br                 ΓöéCauses a break in a line of text        Γöé
  6852. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6853. Γöé:ddf                ΓöéDisplay dynamically formatted text in anΓöé
  6854. Γöé                    Γöéapplication-controlled window           Γöé
  6855. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6856. Γöé:docprof            ΓöéSpecifies the heading-level entries to  Γöé
  6857. Γöé                    Γöébe displayed in the Contents window     Γöé
  6858. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6859. Γöé:font               ΓöéChanges the font to the specified       Γöé
  6860. Γöé                    Γöétypeface, size, and code page.          Γöé
  6861. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6862. Γöé:table              ΓöéFormats information as a table          Γöé
  6863. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6864. Γöé:title              ΓöéProvides a name for the online document Γöé
  6865. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6866.  
  6867. In addition, dynamic data formatting (DDF) is accomplished through a new set of 
  6868. functions. The following table summarizes the new DDF functions. 
  6869.  
  6870. Version 2.0 DDF Functions 
  6871.  
  6872. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6873. ΓöéName                ΓöéFunction Description                    Γöé
  6874. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6875. ΓöéDdfBeginList        ΓöéBegin a definition list                 Γöé
  6876. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6877. ΓöéDdfBitmap           ΓöéPlace a reference to a bit map in the   Γöé
  6878. Γöé                    ΓöéDDF buffer                              Γöé
  6879. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6880. ΓöéDdfEndList          ΓöéEnd a definition list                   Γöé
  6881. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6882. ΓöéDdfHyperText        ΓöéDefine a hypertext link to another panelΓöé
  6883. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6884. ΓöéDdfInform           ΓöéDefine a hypertext inform link          Γöé
  6885. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6886. ΓöéDdfInitialize       ΓöéInitialize the IPF internal structures  Γöé
  6887. Γöé                    Γöéfor dynamic data formatting and returns Γöé
  6888. Γöé                    Γöéa DDF handle.                           Γöé
  6889. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6890. ΓöéDdfListItem         ΓöéInsert a definition list entry in the   Γöé
  6891. Γöé                    ΓöéDDF buffer                              Γöé
  6892. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6893. ΓöéDdfMetafile         ΓöéPlace a reference to a metafile in the  Γöé
  6894. Γöé                    ΓöéDDF buffer                              Γöé
  6895. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6896. ΓöéDdfPara             ΓöéCreate a paragraph within the DDF bufferΓöé
  6897. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6898. ΓöéDdfSetColor         ΓöéSet the background and foreground colorsΓöé
  6899. Γöé                    Γöéof displayed text                       Γöé
  6900. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6901. ΓöéDdfSetFont          ΓöéSpecify a text font in the DDF buffer   Γöé
  6902. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6903. ΓöéDdfSetFontStyle     ΓöéSpecify a text font style in the DDF    Γöé
  6904. Γöé                    Γöébuffer                                  Γöé
  6905. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6906. ΓöéDdfSetFormat        ΓöéTurn formatting off or on               Γöé
  6907. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6908. ΓöéDdfSetTextAlign     ΓöéDefine whether left, center, or right   Γöé
  6909. Γöé                    Γöétext justification is to be used when   Γöé
  6910. Γöé                    Γöéthe text formatting is off.             Γöé
  6911. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6912. ΓöéDdfText             ΓöéAdd text to the DDF buffer              Γöé
  6913. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6914.  
  6915.  
  6916. ΓòÉΓòÉΓòÉ 4.2.4. 32-Bit Migration ΓòÉΓòÉΓòÉ
  6917.  
  6918. In a mixed-model environment, 16-bit code interacts with 32-bit code, and 
  6919. 16-bit window procedures send messages to 32-bit window procedures.  For 
  6920. system-defined messages, PM performs the necessary translation through a thunk 
  6921. layer.  For user-defined messages, however, applications must create 16-bit to 
  6922. 32-bit thunk procedures to manage 16-bit window-message parameters, to convert 
  6923. 16-bit segmented pointer parameters to 32-bit flat pointers and, if necessary, 
  6924. to convert structures pointed to by parameters. 
  6925.  
  6926. Applications provide the thunking layer through new migration functions, which 
  6927. are listed in the following table. 
  6928.  
  6929. Version 2.0 Migration Functions 
  6930.  
  6931. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6932. ΓöéName                    ΓöéDescription                         Γöé
  6933. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6934. ΓöéWinQueryWindowMode      ΓöéQuery the memory model associated   Γöé
  6935. Γöé                        Γöéwith a window                       Γöé
  6936. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6937. ΓöéWinSetWindowThunkProc   ΓöéSet a thunk procedure for a window  Γöé
  6938. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6939. ΓöéWinQueryWindowThunkProc ΓöéQuery a thunk procedure for a windowΓöé
  6940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6941. ΓöéWinSetClassThunkProc    ΓöéAssociate a thunk procedure with a  Γöé
  6942. Γöé                        Γöéwindow class                        Γöé
  6943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6944. ΓöéWinQueryClassThunkProc  ΓöéQuery the pointer-conversion        Γöé
  6945. Γöé                        Γöéprocedure associated with a window  Γöé
  6946. Γöé                        Γöéclass                               Γöé
  6947. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6948.  
  6949.  
  6950. ΓòÉΓòÉΓòÉ 4.2.5. Standard Font-and File-Dialog Boxes ΓòÉΓòÉΓòÉ
  6951.  
  6952. In OS/2 2.0, PM provides functions that enable applications to create standard 
  6953. font and file dialog boxes.  Standard dialogs boxes across applications save 
  6954. application code and increase user productivity through a consistent interface. 
  6955. Standard dialogs boxes are extendable (applications can add controls) and 
  6956. customizable (applications can change button text, window title text). 
  6957.  
  6958. File dialog functions request file names from users and perform file-name 
  6959. validation.  Applications initialize fields and filter strings, and can specify 
  6960. modal or non-modal dialog boxes and single or multiple-file selections.  A file 
  6961. dialog can be implemented as either an Open or a SaveAs dialog. The following 
  6962. figures are examples of these two dialogs. 
  6963.  
  6964. Open Dialog 
  6965.  
  6966. SaveAs Dialog 
  6967.  
  6968. Font dialog boxes request font definitions from users, provide preview windows, 
  6969. and return font face names, point size, boldness, and other specifications. 
  6970. Applications can specify modal or non-modal dialogs, color selection functions, 
  6971. and single or multiple font selection. 
  6972.  
  6973. The following figure shows a sample font dialog box. 
  6974.  
  6975. Font Dialog 
  6976.  
  6977. The following table lists the new font-and file-dialog functions. 
  6978.  
  6979. Font and File Dialog Functions 
  6980.  
  6981. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6982. ΓöéName                ΓöéDescription                             Γöé
  6983. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6984. ΓöéWinFileDlg          ΓöéCreate and display the file dialog box  Γöé
  6985. Γöé                    Γöéand return the user's selection or      Γöé
  6986. Γöé                    Γöéselections                              Γöé
  6987. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6988. ΓöéWinFontDlg          ΓöéAllow a user to select a font           Γöé
  6989. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6990.  
  6991.  
  6992. ΓòÉΓòÉΓòÉ 4.2.6. Window Controls ΓòÉΓòÉΓòÉ
  6993.  
  6994. The following new window controls have been defined for PM in OS/2 2.0: 
  6995. notebook, container, value set, and slider. 
  6996.  
  6997.  
  6998. ΓòÉΓòÉΓòÉ 4.2.6.1. Notebook Control ΓòÉΓòÉΓòÉ
  6999.  
  7000. This window control organizes access to multiple groups of controls. The 
  7001. overall appearance of this control is a notebook.  An application can 
  7002. dynamically insert or delete pages, specify colors for different notebook 
  7003. areas, and resize parts of the notebook.  The content of each page is defined 
  7004. and managed by the application. The following figure shows an example of a 
  7005. notebook control window. 
  7006.  
  7007. Notebook Control Window 
  7008.  
  7009. The following figure lists the window class, styles, and messages associated 
  7010. with this new window control. 
  7011.  
  7012.  
  7013. Control Window Classes, Styles, and Messages
  7014.  
  7015. Window Class
  7016.  
  7017. WC_NOTEBOOK
  7018.  
  7019. Window Styles
  7020.  
  7021. Back-Page Intersection:
  7022.  
  7023.       BKS_BACKPAGESBR
  7024.  
  7025.       BKS_BACKPAGESBL
  7026.  
  7027.       BKS_BACKPAGESTR
  7028.  
  7029.       BKS_BACKPAGESTL
  7030.  
  7031. Major-Tab Side:
  7032.  
  7033.       BKS_MAJORTABRIGHT
  7034.  
  7035.       BKS_MAJORTABLEFT
  7036.  
  7037.       BKS_MAJORTABTOP
  7038.  
  7039.       BKS_MAJORTABBOTTOM
  7040.  
  7041. Shape of Notebook Tabs:
  7042.  
  7043.       BKS_SQUARETABS
  7044.  
  7045.       BKS_ROUNDEDTABS
  7046.  
  7047.       BKS_POLYGONTABS
  7048.  
  7049. Position of Status-Line Text:
  7050.  
  7051.       BKS_STATUSTEXTLEFT
  7052.  
  7053.       BKS_STATUSTEXTRIGHT
  7054.  
  7055.       BKS_STATUSTEXTCENTER
  7056.  
  7057. Window Messages
  7058.  
  7059. Notebook Notification:
  7060.  
  7061.       BKN_NEWPAGESIZE
  7062.  
  7063.       BKN_PAGESELECTED
  7064.  
  7065. Notebook Page:
  7066.  
  7067.       BKM_CALCPAGERECT
  7068.  
  7069.       BKM_DELETEPAGE
  7070.  
  7071.       BKM_INSERTPAGE
  7072.  
  7073.       BKM_INVALIDATETABS
  7074.  
  7075.       BKM_TURNTOPAGE
  7076.  
  7077. Query Notebook:
  7078.  
  7079.       BKM_QUERYPAGECOUNT
  7080.  
  7081.       BKM_QUERYPAGEID
  7082.  
  7083.       BKM_QUERYPAGEULONG
  7084.  
  7085.       BKM_QUERYPAGEWINDOWHWND
  7086.  
  7087.       BKM_QUERYTABBITMAP
  7088.  
  7089.       BKM_QUERYTABTEXT
  7090.  
  7091. Set Notebook:
  7092.  
  7093.       BKM_SETDIMENSIONS
  7094.  
  7095.       BKM_SETPAGEULONG
  7096.  
  7097.       BKM_SETPAGEWINDOWHWND
  7098.  
  7099.       BKM_SETSTATUSLINETEXT
  7100.  
  7101.       BKM_SETTABBITMAP
  7102.  
  7103.       BKM_SETTABTEXT
  7104.  
  7105.  
  7106. ΓòÉΓòÉΓòÉ 4.2.6.2. Container Control ΓòÉΓòÉΓòÉ
  7107.  
  7108. A container control is a visual component whose specific purpose is to hold 
  7109. objects.  A container can display objects in various formats and views.  Each 
  7110. view generally presents different information about each object. 
  7111.  
  7112. This window control displays and processes the user's selection of objects. 
  7113. Selection can be defined as autoselect, extended select, marquee select, 
  7114. multiple select, or single select.  This control supports direct manipulation 
  7115. of objects, enabling users to drag an object from a container window and drop 
  7116. it on another object or container window. The following figure shows an example 
  7117. of a container control. 
  7118.  
  7119. Container Control Window 
  7120.  
  7121. The following figure lists the window class, styles and messages associated 
  7122. with this new window control. 
  7123.  
  7124.  
  7125. Container Control Window Classes, Styles, and Messages
  7126.  
  7127. Window Class
  7128.  
  7129. WC_CONTAINER
  7130.  
  7131. Window Styles
  7132.  
  7133. Control Styles:
  7134.  
  7135.       CS_AUTOPOSITION
  7136.  
  7137.       CS_AUTOSELECTION
  7138.  
  7139.       CS_READONLY
  7140.  
  7141.       CS_VERIFYPOINTERS
  7142.  
  7143. Selection Types:
  7144.  
  7145.       CS_SINGLESEL
  7146.  
  7147.       CS_EXTENDSEL
  7148.  
  7149.       CS_MULTIPLESEL
  7150.  
  7151. Window Messages
  7152.  
  7153. Container Notification:
  7154.  
  7155.       CN_DRAGAFTER
  7156.  
  7157.       CN_DRAGLEAVE
  7158.  
  7159.       CN_DRAGOVER
  7160.  
  7161.       CN_DROP
  7162.  
  7163.       CN_DROPHELP
  7164.  
  7165.       CN_EMPHASIS
  7166.  
  7167.       CN_ENDEDIT
  7168.  
  7169.       CN_ENTER
  7170.  
  7171.       CN_INITDRAG
  7172.  
  7173.       CN_KILLFOCUS
  7174.  
  7175.       CN_QUERYDELTA
  7176.  
  7177.       CN_REALLOCPSZ
  7178.  
  7179.       CN_SCROLL
  7180.  
  7181.       CN_SETFOCUS
  7182.  
  7183. Record:
  7184.  
  7185.       CM_ALLOCRECORD
  7186.  
  7187.       CM_FREERECORD
  7188.  
  7189.       CM_INSERTRECORD
  7190.  
  7191.       CM_INVALIDATERECORD
  7192.  
  7193.       CM_QUERYRECORD
  7194.  
  7195.       CM_REMOVERECORD
  7196.  
  7197. Details View Columns:
  7198.  
  7199.       CM_ALLOCDETAILFIELDINFO
  7200.  
  7201.       CM_FREEDETAILFIELDINFO
  7202.  
  7203.       CM_HORZSCROLLSPLITWINDOW
  7204.  
  7205.       CM_INSERTDETAILFIELDINFO
  7206.  
  7207.       CM_INVALIDATEDETAILFIELDINFO
  7208.  
  7209.       CM_QUERYDETAILFIELDINFO
  7210.  
  7211.       CM_REMOVEDETAILFIELDINFO
  7212.  
  7213. General Container:
  7214.  
  7215.       CM_ARRANGE
  7216.  
  7217.       CM_CLOSEEDIT
  7218.  
  7219.       CM_ERASERECORD
  7220.  
  7221.       CM_FILTER
  7222.  
  7223.       CM_OPENEDIT
  7224.  
  7225.       CM_PAINTBACKGROUND
  7226.  
  7227.       CM_QUERYCNRINFO
  7228.  
  7229.       CM_QUERYDRAGIMAGE
  7230.  
  7231.       CM_QUERYRECORDEMPHASIS
  7232.  
  7233.       CM_QUERYRECORDFROMRECT
  7234.  
  7235.       CM_QUERYRECORDRECT
  7236.  
  7237.       CM_QUERYVIEWPORTRECT
  7238.  
  7239.       CM_SCROLLWINDOW
  7240.  
  7241.       CM_SEARCHSTRING
  7242.  
  7243.       CM_SETCNRINFO
  7244.  
  7245.       CM_SETRECORDEMPHASIS
  7246.  
  7247.       CM_SORTRECORD
  7248.  
  7249.  
  7250. ΓòÉΓòÉΓòÉ 4.2.6.3. Value Set ΓòÉΓòÉΓòÉ
  7251.  
  7252. A value-set control is a visual component that enables a user to select one 
  7253. choice from a group of mutually-exclusive choices.  A value set can use graphic 
  7254. images (bit maps or icons), as well as colors, text, and numbers, to represent 
  7255. the items that a user can select.  An application can specify different types 
  7256. of items, sizes, and orientations for its value sets. The following figure 
  7257. shows an example of a value-set control. 
  7258.  
  7259. Value-Set Control 
  7260.  
  7261. The following figure lists the window class, styles, and messages associated 
  7262. with this new window control. 
  7263.  
  7264.  
  7265. Value-Set Control Window Classes, Styles, and Messages
  7266.  
  7267. Window Class
  7268.  
  7269. WC_VALUESET
  7270.  
  7271. Window Styles
  7272.  
  7273. VS_BITMAP
  7274.  
  7275. VS_ICON
  7276.  
  7277. VS_TEXT
  7278.  
  7279. VS_RGB
  7280.  
  7281. VS_COLORINDEX
  7282.  
  7283. VS_BORDER
  7284.  
  7285. VS_ITEMBORDER
  7286.  
  7287. VS_RIGHTTOLEFT
  7288.  
  7289. Messages
  7290.  
  7291. Value Set Notification:
  7292.  
  7293.       VN_DRAGLEAVE
  7294.  
  7295.       VN_DRAGOVER
  7296.  
  7297.       VN_DROP
  7298.  
  7299.       VN_DROPHELP
  7300.  
  7301.       VN_ENTER
  7302.  
  7303.       VN_INITDRAG
  7304.  
  7305.       VN_KILLFOCUS
  7306.  
  7307.       VN_SELECT
  7308.  
  7309.       VN_SETFOCUS
  7310.  
  7311. Query Value Set:
  7312.  
  7313.       VM_QUERYITEM
  7314.  
  7315.       VM_QUERYITEMATTR
  7316.  
  7317.       VM_QUERYMETRICS
  7318.  
  7319.       VM_QUERYSELECTEDITEM
  7320.  
  7321. Set Value Set:
  7322.  
  7323.       VM_SELECTITEM
  7324.  
  7325.       VM_SETITEM
  7326.  
  7327.       VM_SETITEMATTR
  7328.  
  7329.       VM_SETMETRICS
  7330.  
  7331.  
  7332. ΓòÉΓòÉΓòÉ 4.2.6.4. Slider ΓòÉΓòÉΓòÉ
  7333.  
  7334. A slider control enables a user to set, display, or modify a value by moving a 
  7335. slider arm.  The appearance of a slider, and how the user uses it, is similar 
  7336. to a scroll bar.  However, they are not interchangeable because each has a 
  7337. distinct purpose.  The scroll bar makes visible information that is outside a 
  7338. window's client area; the slider is used to set, display, or modify 
  7339. information, whether it is in the client area or not.  Applications can specify 
  7340. different scales, sizes, and orientations for its sliders. The following figure 
  7341. shows an example of a slider control. 
  7342.  
  7343. Slider Control 
  7344.  
  7345. The following figure lists the window class, styles, and messages associated 
  7346. with this new window control. 
  7347.  
  7348.  
  7349. Slider Control Window Classes, Styles, and Messages
  7350.  
  7351. Window Class
  7352.  
  7353. WC_SLIDER
  7354.  
  7355. Window Styles
  7356.  
  7357. Orientation:
  7358.  
  7359.       SLS_HORIZONTAL
  7360.  
  7361.       SLS_VERTICAL
  7362.  
  7363. Position:
  7364.  
  7365.       SLS_CENTER
  7366.  
  7367.       SLS_BOTTOM
  7368.  
  7369.       SLS_TOP
  7370.  
  7371.       SLS_LEFT
  7372.  
  7373.       SLS_RIGHT
  7374.  
  7375. Scale Location on Shaft:
  7376.  
  7377.       SLS_PRIMARYSCALE1
  7378.  
  7379.       SLS_PRIMARYSCALE2
  7380.  
  7381. Slider-Arm's Home Position:
  7382.  
  7383.       SLS_HOMELEFT
  7384.  
  7385.       SLS_HOMERIGHT
  7386.  
  7387.       SLS_HOMEBOTTOM
  7388.  
  7389.       SLS_HOMETOP
  7390.  
  7391. Slider-Button Locations:
  7392.  
  7393.       SLS_BUTTONSLEFT
  7394.  
  7395.       SLS_BUTTONSRIGHT
  7396.  
  7397.       SLS_BUTTONSBOTTOM
  7398.  
  7399.       SLS_BUTTONSTOP
  7400.  
  7401. Miscellaneous:
  7402.  
  7403.       SLS_SNAPTOINCREMENT
  7404.  
  7405.       SLS_READONLY
  7406.  
  7407.       SLS_RIBBONSTRIP
  7408.  
  7409.       SLS_OWNERDRAW
  7410.  
  7411. Window Messages
  7412.  
  7413. Slider Notification:
  7414.  
  7415.       SLN_CHANGE
  7416.  
  7417.       SLN_SLIDERTRACK
  7418.  
  7419.       SLN_KILLFOCUS
  7420.  
  7421.       SLN_SETFOCUS
  7422.  
  7423. Query Slider:
  7424.  
  7425.       SLM_QUERYDETENTPOS
  7426.  
  7427.       SLM_QUERYSCALETEXT
  7428.  
  7429.       SLM_QUERYSLIDERINFO
  7430.  
  7431.       SLM_QUERYTICKPOS
  7432.  
  7433.       SLM_QUERYTICKSIZE
  7434.  
  7435. Set Slider:
  7436.  
  7437.       SLM_SETSCALETEXT
  7438.  
  7439.       SLM_SETSLIDERINFO
  7440.  
  7441.       SLM_SETTICKSIZE
  7442.  
  7443. Add or Remove Detent:
  7444.  
  7445.       SLM_ADDETENT
  7446.  
  7447.       SLM_REMOVEDETENT
  7448.  
  7449.  
  7450. ΓòÉΓòÉΓòÉ 4.2.7. Pop-Up Menus ΓòÉΓòÉΓòÉ
  7451.  
  7452. In OS/2 2.0, PM provides a function, WinPopupMenu, that enables an application 
  7453. to display a pop-up menu.  A pop-up menu is a menu that, when requested, is 
  7454. displayed next to the object with which it is associated. It contains choices 
  7455. appropriate for a given object or set of objects in their current context. 
  7456.  
  7457.  
  7458. ΓòÉΓòÉΓòÉ 4.2.8. Desktop Background ΓòÉΓòÉΓòÉ
  7459.  
  7460. In OS/2 2.0, PM provides functions that enables applications to fill the 
  7461. Desktop background with a specified bit map.  Bit maps can be centered, tiled, 
  7462. or scaled in the Desktop background.  The Desktop background functions are 
  7463. WinSetDesktopBkgnd and WinQueryDesktopBkgnd.  These functions will work only 
  7464. when the Workplace Shell is not active, and can be used by an application that 
  7465. replaces the shell. 
  7466.  
  7467.  
  7468. ΓòÉΓòÉΓòÉ 4.2.9. Hooks ΓòÉΓòÉΓòÉ
  7469.  
  7470. In OS/2 2.0, PM provides new window-manager hook capabilities. Applications can 
  7471. apply message filtering when WinGetMsg, WinPeekMsg, or WinWaitMsg is called 
  7472. through the hook, CheckMsgFilterHook. This enables applications to examine new 
  7473. messages in the main event loop between the time they retrieve the message from 
  7474. the queue and the time they dispatch it, performing special processing as 
  7475. appropriate. Applications also can filter the window-destroy process with the 
  7476. hook, DestroyWindowHook.  This hook is called after the WM_DESTROY message is 
  7477. processed but before the window handle becomes invalid.  It replaces the 
  7478. WinRegisterWindowDestroy function. 
  7479.  
  7480.  
  7481. ΓòÉΓòÉΓòÉ 4.2.10. Paths, Regions, and Bit Maps ΓòÉΓòÉΓòÉ
  7482.  
  7483. In OS/2 2.0, PM provides new functions for paths, regions, and bit maps: 
  7484.  
  7485. o Paths can be converted into regions. 
  7486. o More operations can be performed on regions. 
  7487. o Areas can be filled easily. 
  7488. o A bit map can be copied from storage to a bit map in a device context. 
  7489. The following table lists these new functions. 
  7490.  
  7491. Path, Region, and Bit Map Functions 
  7492.  
  7493. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7494. ΓöéName                ΓöéFunction Description                    Γöé
  7495. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7496. ΓöéGpiDrawBits         ΓöéDraw a rectangle of bits.               Γöé
  7497. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7498. ΓöéGpiFloodFill        ΓöéFill an area bounded by a given color orΓöé
  7499. Γöé                    Γöéwhile on a given color.                 Γöé
  7500. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7501. ΓöéGpiFrameRegion      ΓöéDraw a frame inside a region using the  Γöé
  7502. Γöé                    Γöécurrent pattern attributes.             Γöé
  7503. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7504. ΓöéGpiPathToRegion     ΓöéConvert a path into a region.           Γöé
  7505. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7506.  
  7507.  
  7508. ΓòÉΓòÉΓòÉ 4.2.11. Fonts and Characters ΓòÉΓòÉΓòÉ
  7509.  
  7510. In OS/2 2.0, PM provides new functions that give applications greater ability 
  7511. to inquire about logical fonts and face names, the ability to modify the 
  7512. default font, and extra character spacing for text justification. The following 
  7513. table lists the new functions. 
  7514.  
  7515. Font and Character Functions 
  7516.  
  7517. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7518. ΓöéName                    ΓöéFunction Description                Γöé
  7519. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7520. ΓöéGpiLoadPublicFonts      ΓöéLoad one or more fonts from the     Γöé
  7521. Γöé                        Γöéspecified resource file, to be      Γöé
  7522. Γöé                        Γöéavailable for all applications.     Γöé
  7523. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7524. ΓöéGpiQueryCharBreakExtra  ΓöéReturn the current value of the     Γöé
  7525. Γöé                        Γöécharacter-break-extra attribute.    Γöé
  7526. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7527. ΓöéGpiQueryCharExtra       ΓöéReturn the current value of the     Γöé
  7528. Γöé                        Γöécharacter-extra attribute.          Γöé
  7529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7530. ΓöéGpiQueryCharOutline     ΓöéReturn the drawing order of a       Γöé
  7531. Γöé                        Γöécharacter outline.                  Γöé
  7532. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7533. ΓöéGpiQueryFaceString      ΓöéGenerate a compound face name for a Γöé
  7534. Γöé                        Γöéfont.                               Γöé
  7535. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7536. ΓöéGpiQueryLogicalFont     ΓöéReturn the description of a logical Γöé
  7537. Γöé                        Γöéfont.                               Γöé
  7538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7539. ΓöéGpiSetCharBreakExtra    ΓöéSpecify an extra increment to be    Γöé
  7540. Γöé                        Γöéused for spacing break characters inΓöé
  7541. Γöé                        Γöéa string, for example, space        Γöé
  7542. Γöé                        Γöécharacters.                         Γöé
  7543. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7544. ΓöéGpiSetCharExtra         ΓöéSpecify an extra increment to be    Γöé
  7545. Γöé                        Γöéused for spacing characters in a    Γöé
  7546. Γöé                        Γöéstring.                             Γöé
  7547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7548. ΓöéGpiUnloadPublicFonts    ΓöéUnload one or more generally        Γöé
  7549. Γöé                        Γöéavailable fonts.                    Γöé
  7550. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7551.  
  7552.  
  7553. ΓòÉΓòÉΓòÉ 4.2.12. Polylines ΓòÉΓòÉΓòÉ
  7554.  
  7555. Polyline Functions 
  7556.  
  7557. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7558. ΓöéName                ΓöéFunction Description                    Γöé
  7559. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7560. ΓöéGpiPolylineDisjoint ΓöéDraw a series of disjoint straight linesΓöé
  7561. Γöé                    Γöéusing the end-point pairs specified.    Γöé
  7562. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7563.  
  7564.  
  7565. ΓòÉΓòÉΓòÉ 4.2.13. Transformations ΓòÉΓòÉΓòÉ
  7566.  
  7567. Transformation Functions 
  7568.  
  7569. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7570. ΓöéName                    ΓöéFunction Description                Γöé
  7571. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7572. ΓöéGpiConvertWithMatrix    ΓöéConvert an array of coordinate pairsΓöé
  7573. Γöé                        Γöéfrom one coordinate space to        Γöé
  7574. Γöé                        Γöéanother, using the supplied         Γöé
  7575. Γöé                        Γöétransform matrix.                   Γöé
  7576. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7577.  
  7578.  
  7579. ΓòÉΓòÉΓòÉ 4.2.14. PM Helper Macros ΓòÉΓòÉΓòÉ
  7580.  
  7581. A set of helper macros is defined in the PMWIN.H header files for OS/2 2.0 PM. 
  7582. These macros simplify programming for button, list-box, and menu controls. 
  7583. Previously, programmers had to set up complex parameters to send messages to 
  7584. the control windows in order to modify list-box items, menu items, and so 
  7585. forth.  The new macros provide the code expansions for these complex functions. 
  7586. The following table lists the new helper macros. 
  7587.  
  7588. PM Helper Macros 
  7589.  
  7590. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7591. ΓöéName                    ΓöéFunction Description                Γöé
  7592. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7593. ΓöéWinCheckButton          ΓöéSet the checked state of the        Γöé
  7594. Γöé                        Γöéspecified button control.           Γöé
  7595. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7596. ΓöéWinCheckMenuItem        ΓöéSet the check state of the specifiedΓöé
  7597. Γöé                        Γöémenu item.                          Γöé
  7598. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7599. ΓöéWinDeleteLboxItem       ΓöéDelete an indexed item from the listΓöé
  7600. Γöé                        Γöébox.                                Γöé
  7601. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7602. ΓöéWinEnableControl        ΓöéSet the enable state of the item in Γöé
  7603. Γöé                        Γöéthe dialog template.                Γöé
  7604. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7605. ΓöéWinEnableMenuItem       ΓöéSet the state of the specified menu Γöé
  7606. Γöé                        Γöéitem.                               Γöé
  7607. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7608. ΓöéWinInsertLboxItem       ΓöéInsert text into a list box at      Γöé
  7609. Γöé                        Γöéindex.                              Γöé
  7610. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7611. ΓöéWinIsControlEnabled     ΓöéReturn the state of the specified   Γöé
  7612. Γöé                        Γöéitem in the dialog template.        Γöé
  7613. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7614. ΓöéWinIsMenuItemChecked    ΓöéReturn the state of the identified  Γöé
  7615. Γöé                        Γöémenu item.                          Γöé
  7616. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7617. ΓöéWinIsMenuItemEnabled    ΓöéReturn the state of the menu item   Γöé
  7618. Γöé                        Γöéspecified.                          Γöé
  7619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7620. ΓöéWinIsMenuItemValid      ΓöéReturn TRUE if the specified item isΓöé
  7621. Γöé                        Γöéa valid choice.                     Γöé
  7622. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7623. ΓöéWinQueryButtonCheckStateΓöéReturn the checked state of the     Γöé
  7624. Γöé                        Γöébutton control specified.           Γöé
  7625. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7626. ΓöéWinQueryLboxCount       ΓöéReturn the number of items in the   Γöé
  7627. Γöé                        Γöélist box.                           Γöé
  7628. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7629. ΓöéWinQueryLboxItemText    ΓöéFill the buffer with the text of theΓöé
  7630. Γöé                        Γöéindexed item.                       Γöé
  7631. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7632. ΓöéWinQueryLboxItemTextLengΓöéReturn the length of the text of theΓöé
  7633. Γöé                        Γöéindexed item in the list box.       Γöé
  7634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7635. ΓöéWinQueryLboxSelectedItemΓöéReturn the index of the selected    Γöé
  7636. Γöé                        Γöéitem in the list box.               Γöé
  7637. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7638. ΓöéWinSetLboxItemText      ΓöéSet the text of the list box indexedΓöé
  7639. Γöé                        Γöéitem to buffer.                     Γöé
  7640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7641. ΓöéWinSetMenuItemText      ΓöéSet the text for menu indexed item  Γöé
  7642. Γöé                        Γöéto buffer.                          Γöé
  7643. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7644.  
  7645.  
  7646. ΓòÉΓòÉΓòÉ 4.3. Summary ΓòÉΓòÉΓòÉ
  7647.  
  7648. Many Control Program functions have been renamed, replaced, or enhanced. The 
  7649. new guidelines used for naming functions ensure compliance with Get, Set, and 
  7650. Query semantics used in PM-SAA conventions, the use of action verbs before 
  7651. nouns, and the use of consistent semantics for similar actions.  Some 16-bit 
  7652. functions have been redesigned for the 32-bit environment, in particular, 
  7653. memory-management, semaphore, and signal functions. 
  7654.  
  7655. Control Program functions that have changed in the 32-bit version of the 
  7656. operating system include: 
  7657.  
  7658. o Memory management functions 
  7659. o Thread and process functions 
  7660. o Semaphore functions 
  7661. o Pipe, queue, and timer functions 
  7662. o Dynamic-linking functions 
  7663. o Device I/O functions 
  7664. o File system functions 
  7665. o Message retrieval functions 
  7666. o Code-page management functions 
  7667. o Session management functions 
  7668. o Error management functions 
  7669. o Signal functions 
  7670. o Exception management functions 
  7671. o VDD services functions. 
  7672.  
  7673. Many 16-bit PM functions have been replaced by new functions in the 32-bit 
  7674. function set, while others are no longer available.  The functions that are no 
  7675. longer available affect the following areas: 
  7676.  
  7677. o Heap management 
  7678. o Installed program list 
  7679. o Initialization file 
  7680. o Window locking. 
  7681.  
  7682. New functions are available for: 
  7683.  
  7684. o Printing 
  7685. o Workplace 
  7686. o Customizing Help information 
  7687. o 32-bit migration 
  7688. o Standard dialogs 
  7689. o Pop-up menus 
  7690. o Desktop background 
  7691. o Paths, regions, and bit maps 
  7692. o Fonts and characters 
  7693. o Polylines 
  7694. o Transformations. 
  7695.  
  7696. In addition, new window controls, hook capabilities, and helper macros are 
  7697. provided. 
  7698.  
  7699.  
  7700. ΓòÉΓòÉΓòÉ 5. Dynamic Linking ΓòÉΓòÉΓòÉ
  7701.  
  7702. This chapter describes: 
  7703.  
  7704. o Static vs. dynamic linking 
  7705.  
  7706. o Dynamic link library (DLL) data 
  7707.  
  7708. o DLL initialization and termination 
  7709.  
  7710. o Building a DLL 
  7711.  
  7712. o Use of protected memory by DLLs. 
  7713.  
  7714.  
  7715. ΓòÉΓòÉΓòÉ 5.1. Static vs. Dynamic Linking ΓòÉΓòÉΓòÉ
  7716.  
  7717. Most programmers are familiar with static linking; an application calls a 
  7718. routine or procedure whose code is not found in the application's source file. 
  7719. The routine is external to your source file and is declared as such.  When the 
  7720. source file is compiled, the compiler places an external reference for the 
  7721. routine in the application's object (.OBJ) file.  To create the executable file 
  7722. (.EXE) for the application, the application's object file is linked with an 
  7723. object file that contains the code for the routine.  The result is an EXE file 
  7724. that contains the application code, as well as a copy of the code for the 
  7725. routine. The following figure illustrates the process of building a statically 
  7726. linked application. 
  7727.  
  7728.    My_Application.OBJ
  7729.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7730.   Γöé EXTERNAL               Γöé
  7731.   Γöé     Your_Routine       Γöé
  7732.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7733.   Γöé .                      Γöé                  My_Application.EXE
  7734.   Γöé .                      Γöé                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7735.   Γöé CALL ???; Your_Routine Γö£ΓöÇΓöÇΓöÉ              Γöé .                Γöé
  7736.   Γöé                        Γöé  Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé .                Γöé
  7737.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γö£ΓöÇΓöé LINK Γö£ΓöÇΓöÇΓöÇΓöé CALL xxx         Γöé
  7738.                               Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé .                Γöé
  7739.    Your_Library.OBJ           Γöé              Γöé                  Γöé
  7740.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé         xxx: Γöé Your_Routine:    Γöé
  7741.   Γöé PUBLIC                 Γöé  Γöé              Γöé                  Γöé
  7742.   Γöé     Your_Routine       Γöé  Γöé              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7743.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé
  7744.   Γöé                        Γöé  Γöé
  7745.   Γöé Your_Routine:          Γöé  Γöé
  7746.   Γöé                        Γö£ΓöÇΓöÇΓöÿ
  7747.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7748.  
  7749. Static Linking 
  7750.  
  7751. When OS/2 2.0 loads a statically linked program, all the code and data are 
  7752. contained in a single EXE file and the system can load it into memory all at 
  7753. once. 
  7754.  
  7755. The advantages and disadvantages of static linking are summarized in the 
  7756. following table. 
  7757.  
  7758. Why Static Linking? 
  7759.  
  7760. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7761. ΓöéAdvantages                    ΓöéDisadvantages                 Γöé
  7762. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7763. ΓöéCompile in pieces             ΓöéExternal routines built into  Γöé
  7764. Γöé                              ΓöéEXE (making EXEs larger)      Γöé
  7765. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7766. ΓöéCan create libraries of       ΓöéEXE cannot be changed without Γöé
  7767. Γöéroutines that can be linked   Γöérelinking.                    Γöé
  7768. Γöéwith applications.            Γöé                              Γöé
  7769. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7770. Γöé                              ΓöéExternal routines cannot be   Γöé
  7771. Γöé                              Γöéshared (duplicate copies of   Γöé
  7772. Γöé                              Γöélibraries).                   Γöé
  7773. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7774.  
  7775. Dynamic linking permits several applications to use a single copy of an 
  7776. executable module.  The executable module is completely separate from the 
  7777. applications that use it.  Several functions can be built into a DLL, and 
  7778. applications can use these functions as though they were part of the 
  7779. application's executable code.  You can change the dynamically-linked functions 
  7780. without recompiling or relinking the application. 
  7781.  
  7782. The advantages of dynamic linking are: 
  7783.  
  7784. Reduced memory requirements 
  7785.  
  7786. Many applications can use a single DLL simultaneously.  Since only one copy of 
  7787. the DLL is in memory, this saves memory space and, in general, the code is 
  7788. discardable. 
  7789.  
  7790. Simplified application modification 
  7791.  
  7792. An application can be enhanced or modified simply by changing a DLL. For 
  7793. example, if an application uses a DLL to support video output, several displays 
  7794. can be supported by different DLLs.  The application can use the DLL that 
  7795. supports the appropriate display. 
  7796.  
  7797. Flexible software support 
  7798.  
  7799. DLLs can be used for after-market support.  In the display-driver example, a 
  7800. new DLL can be provided to support a display that was not available when the 
  7801. application was shipped.  Similarly, a database application can support a new 
  7802. data-file format with a new DLL. 
  7803.  
  7804. Transparent migration of function 
  7805.  
  7806. The DLL functions can be used by applications without any understanding of how 
  7807. the functions actually do their work.  Future changes to the DLL are 
  7808. transparent to the application, as long as the input and output parameters 
  7809. remain the same. 
  7810.  
  7811. Multiple programming language support 
  7812.  
  7813. A function in a DLL can be used by an application written in any programming 
  7814. language, as long as the application understands the function's calling 
  7815. convention. 
  7816.  
  7817. Application-controlled memory usage 
  7818.  
  7819. Applications can make decisions about which DLL routines they want to load into 
  7820. memory and use.  If a DLL is not used, it does not have to be loaded. 
  7821.  
  7822. DLLs can be used to implement subroutine packages, subsystems, and interfaces 
  7823. to other processes.  In OS/2 2.0: 
  7824.  
  7825. o Some DLLs are interfaces to the kernel. 
  7826.  
  7827.   The worker routines for the OS/2 API reside in the OS/2 kernel. Applications, 
  7828.   which run at privilege level 3, usually can make direct calls to the kernel, 
  7829.   which runs at privilege level 0.  Some calls, however, must be linked through 
  7830.   a DLL.  For example, an application that calls DosOpen is linked to the DLL 
  7831.   DOSCALL1.DDL.  This library contains the definitions for some system 
  7832.   functions.  When a system function is called, OS/2 2.0 makes the call to the 
  7833.   kernel on behalf of the application. 
  7834.  
  7835. o Some DLLs are interfaces to devices. 
  7836.  
  7837.   DLL subsystems can virtualize devices and manage the device for its clients. 
  7838.  
  7839. o Some DLLs provide an open system architecture for software. 
  7840.  
  7841.   Add-ons to OS/2 2.0 can be provided easily and by anyone. 
  7842.  
  7843. OS/2 2.0 provides two varieties of dynamic linking: load-time and run-time.  In 
  7844. load-time dynamic linking, references are resolved when an application is 
  7845. loaded.  In run-time dynamic linking, references are resolved when the 
  7846. application runs. 
  7847.  
  7848.  
  7849. ΓòÉΓòÉΓòÉ 5.1.1. Load-Time Dynamic Linking ΓòÉΓòÉΓòÉ
  7850.  
  7851. Load-time dynamic linking is similar to static linking in that an application 
  7852. can call a routine that is not found in the application's source file.  In 
  7853. load-time dynamic linking, however, an application is linked with a library 
  7854. file that contains a record that describes where the routine can be found 
  7855. instead of with a file that contains the code for the routine.  The resulting 
  7856. application executable file contains this record and not a copy of the 
  7857. routine's code. The following figure illustrates the process of building a 
  7858. load-time dynamically linked application. 
  7859.  
  7860. In the example in the following figure, the LIB file contains a record that 
  7861. describes where the code for a set of functions can be found.  In this case, 
  7862. the code for the function Your_Routine can be found in the file, or module, 
  7863. Your_Routines.DLL under the entry point name Your_Routine.  (The entry point 
  7864. name does not have to match the function name.)  The function code also can be 
  7865. referenced by its ordinal value. 
  7866.  
  7867.    My_Application.OBJ
  7868.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7869.   Γöé EXTERNAL               Γöé
  7870.   Γöé     Your_Routine       Γöé
  7871.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7872.   Γöé .                      Γöé                  My_Application.EXE
  7873.   Γöé .                      Γöé                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7874.   Γöé CALL ???; Your_Routine Γö£ΓöÇΓöÇΓöÉ              Γöé .                Γöé
  7875.   Γöé                        Γöé  Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé .                Γöé
  7876.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γö£ΓöÇΓöé LINK Γö£ΓöÇΓöÇΓöÇΓöé CALL ???         Γöé
  7877.                               Γöé  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé .                Γö£ΓöÇΓöÉ
  7878.    Your_Library.LIB           Γöé              Γöé                  Γöé  Γöé
  7879.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé              Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé
  7880.   Γöé                        Γöé  Γöé              Γöé Reference to     Γöé  Γöé
  7881.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ  Γöé              Γöé                  Γöé  Γöé
  7882.   Γöé function name:         Γöé  Γöé              Γöé Your_Routine.1   Γöé  Γöé
  7883.   Γöé       Your_Routine     Γöé  Γöé              Γöé Your_Routine.    Γö£ΓöÇΓöÇΓöÿ
  7884.   Γöé                        Γöé  Γöé              Γöé     Your_Routine Γöé
  7885.   Γöé module name:           Γöé  Γöé              Γöé                  Γöé
  7886.   Γöé       Your_Routines    Γö£ΓöÇΓöÇΓöÿ              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7887.   Γöé                        Γöé
  7888.   Γöé entry point            Γöé
  7889.   Γöé       ordinal value: 1 Γöé
  7890.   Γöé       entry point name Γöé
  7891.   Γöé           Your_Routine Γöé
  7892.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7893.   Γöé                        Γöé
  7894.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7895.  
  7896. Dynamic Linking 
  7897.  
  7898. When the application is loaded, the system resolves the dynamic-link 
  7899. references, as shown in the following figure. 
  7900.  
  7901. My_Application.EXE               Your_Routine.DLL
  7902. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ              ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7903. Γöé  .              Γöé              Γöé   Entry Table   Γöé
  7904. Γöé  .              Γöé              Γöé       1    ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÉ
  7905. Γöé  .              Γöé              Γöé.................Γöé  Γöé
  7906. Γöé Call ???        ΓöéΓöÇΓöÉ           Γöé                 Γöé  Γöé
  7907. Γöé  .              Γöé  Γöé           Γöé                 Γöé  Γöé
  7908. Γöé                 Γöé  Γöé   yyy:    Γöé  Your_Routine:  ΓöéΓöÇΓöÿ
  7909. Γöé                 Γöé  Γöé           Γöé                 Γöé
  7910. Γöé.................Γöé  Γöé           Γöé                 Γöé
  7911. ΓöéReference to     Γöé  Γöé           Γöé                 Γöé
  7912. Γöé                 Γöé  Γöé           Γöé                 Γöé
  7913. ΓöéYour_Routine.1   Γö£ΓöÇΓöÇΓöÿ           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7914. ΓöéYour_Routine.    Γöé                       Γöé
  7915. Γöé     Your RoutineΓöé                       Γöé
  7916. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                       Γöé
  7917.         Γöé                                 Γöé
  7918.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7919.                           Γöé
  7920.                        ΓöîΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÉ
  7921.                        ΓöéLOAD Γöé
  7922.                        ΓööΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ
  7923.                           Γöé
  7924.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7925.         Γöé                                 Γöé
  7926. My_Application code              Other code
  7927. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ              ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7928. Γöé   Call yyy  ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇ yyy:   Γöé  Your_Routine   Γöé
  7929. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ              ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7930.  
  7931. Resolving Dynamic Link References 
  7932.  
  7933. If a program contains dynamically linked references, the system must process 
  7934. the information in the references.  If the DLL already is in memory, the system 
  7935. adds information to the executable code so that the code can use the DLL 
  7936. functions.  If the required DLLs are not already in memory, OS/2 2.0 searches 
  7937. the path specified by the LIBPATH environment variable. If the system cannot 
  7938. find the DLLs, it stops loading the application and reports the error. If the 
  7939. system finds the DLLs, it loads them.  When DLLs are loaded into memory, OS/2 
  7940. 2.0 notifies the application where the DLL functions can be found. 
  7941.  
  7942. When a DLL is loaded into memory is determined by how the DLL was built. A DLL 
  7943. is built like an application, using a module-definition (.DEF) file. The CODE 
  7944. statement in a DEF file describes the attributes of application or DLL code. 
  7945. The load option for the CODE statement determines when application or DLL code 
  7946. is loaded: 
  7947.  
  7948. PRELOAD             Code is loaded as soon as a process accesses the DLL.  This 
  7949.                     leads to increased performance (in terms of accessing the 
  7950.                     DLL functions) while decreasing available memory.  This 
  7951.                     option might be preferable if only one program is running. 
  7952.  
  7953. LOADONCALL          Code is loaded when needed.  This is the recommended choice 
  7954.                     and the default. 
  7955.  
  7956.  
  7957. ΓòÉΓòÉΓòÉ 5.1.2. Run-Time Dynamic Linking ΓòÉΓòÉΓòÉ
  7958.  
  7959. When an application contains a reference to a DLL, the DLL is loaded into 
  7960. memory when the application is loaded (unless the DLL already is in memory). 
  7961. If the application uses functions in several DLLs, all of those DLLs are loaded 
  7962. into memory.  Some applications might use functions in several DLLs but use 
  7963. only a few of them at any one time. For example, an application that supports 
  7964. many different printers or plotters might use functions in many DLLs but need 
  7965. only one of them at a time, depending on the printer or plotter the application 
  7966. is supporting. If the user switches to a different printer or plotter, another 
  7967. DLL will be used, but the first will remain in memory.  Loading DLLs this way 
  7968. can be very wasteful. 
  7969.  
  7970. To avoid this problem, applications can take advantage of run-time dynamic 
  7971. linking in OS/2 2.0 and load and unload DLLs as they are required.  The process 
  7972. of building a run-time dynamically linked application is similar to the process 
  7973. of building a load-time dynamically linked application.  However, the EXE file 
  7974. for a run-time dynamically linked application does not contain a record 
  7975. describing where the external routines can be found.  Instead, the application 
  7976. explicitly tells OS/2 2.0 when to load and free the dynamic link module. 
  7977.  
  7978. Applications load and unload DLLs and call functions whose code resides in 
  7979. those DLLs by: 
  7980.  
  7981.  1. Calling DosLoadModule to get a handle to the DLL module. 
  7982.  
  7983.     This function also loads the DLL into memory or attaches to it, if it 
  7984.     already is loaded. 
  7985.  
  7986.  2. Calling DosQueryProcAddr to get a pointer to a function within the DLL. 
  7987.  
  7988.  3. Calling the function indirectly through the pointer returned by 
  7989.     DosQueryProcAddr. 
  7990.  
  7991.  4. Calling DosFreeModule to free the handle to the DLL module. 
  7992.  
  7993.     When all handles to the DLL module have been freed, the DLL is unloaded 
  7994.     from memory. 
  7995.  
  7996. An application also can request information about a DLL from the system.  The 
  7997. application can use the DosQueryModuleHandle function to determine whether a 
  7998. DLL has been loaded into memory already.  The DosQueryModuleName function 
  7999. returns full path information for the DLL file. 
  8000.  
  8001. Following are the advantages of run-time dynamic linking: 
  8002.  
  8003. Memory is consumed as needed. 
  8004.  
  8005. DLLs can be loaded and unloaded as they are used. Unused DLLs do not have to be 
  8006. loaded into memory, and memory can be released when the application has 
  8007. finished using the DLL. 
  8008.  
  8009. Applications can recover from DLL NOT FOUND. 
  8010.  
  8011. Applications can make decisions.  If a load-time DLL cannot be found, the 
  8012. application terminates immediately.  If a run-time DLL cannot be found, the 
  8013. application receives an error value from the DosLoadModule function, and it can 
  8014. use another DLL or specify a full path for the DLL.  If a function is not 
  8015. available, the DosQueryProcAddr function returns an error value, and the 
  8016. application can take appropriate action. 
  8017.  
  8018. DLL and function names can be variable. 
  8019.  
  8020. An application programmer does not have to know the names of the DLLs the 
  8021. application will be using or the names of the functions within the DLL.  The 
  8022. application can read the names of the DLL or the functions from a configuration 
  8023. file or obtain the names from user-supplied input. 
  8024.  
  8025. DLLs can be anywhere. 
  8026.  
  8027. The application can specify the full path for the DLL.  Load-time DLLs must be 
  8028. in a directory in the path specified by the LIBPATH environment variable, but 
  8029. run-time DLLs can be in other directories. 
  8030.  
  8031.  
  8032. ΓòÉΓòÉΓòÉ 5.2. DLL Data ΓòÉΓòÉΓòÉ
  8033.  
  8034. Most DLLs will contain some data.  Whereas DLL code is shared by all processes 
  8035. that use it, DLL data can be shared or not shared by all processes that use it. 
  8036. Data that is specific to each process that uses the DLL (that is, to each 
  8037. instance of the DLL) is called instance data.  Data that is shared by all 
  8038. processes that use the DLL is called shared or global data. 
  8039.  
  8040. The first time a process references a DLL (and it is loaded or its usage count 
  8041. is incremented because it is already loaded), a separate copy of the DLL's 
  8042. instance data is created.  Modifications to the instance data for one process 
  8043. do not affect the instance data for any other process.  The system, however, 
  8044. maintains only one copy of a DLL's shared data for all processes that use the 
  8045. DLL.  Every process that uses the DLL can access the same data.  If one process 
  8046. modifies the data (increments a count, for example), the data will be modified 
  8047. for all processes that use the DLL. 
  8048.  
  8049. Because changes to shared DLL data by one process are visible to the DLL code 
  8050. when called by another process, shared data provides DLLs with a mechanism for 
  8051. tracking processes that use it.  This is crucial to subsystems, which are DLLs 
  8052. that manage resources (for example, devices, queues, and so forth). 
  8053.  
  8054. There usually is only one data and one code object, or segment, defined in a C 
  8055. source file.  This means that a DLL that has instance and shared data is built 
  8056. from more than one C source file, with a default automatic data segment and 
  8057. with named data segments.  How data is defined is determined by how the DLL is 
  8058. built.  A DLL is built like an application, using a DEF file.  The DATA 
  8059. statement in a DEF file describes the attributes of application or DLL data. 
  8060. Following is a list of the available options for the DATA statement: 
  8061.  
  8062. Options             Result 
  8063.  
  8064. MULTIPLE            OS/2 2.0 creates a unique copy of the automatic data 
  8065.                     segment for each process that uses the DLL.  Modifications 
  8066.                     made by one process do not affect any other process.  This 
  8067.                     is the default. 
  8068.  
  8069. SINGLE              OS/2 2.0 creates only one automatic data segment for all 
  8070.                     processes that use the DLL.  If one process modifies the 
  8071.                     data, the data will be modified for all processes that use 
  8072.                     the DLL. 
  8073.  
  8074. READWRITE           Enables you to read from or write to the automatic data 
  8075.                     segment. This is the default. 
  8076.  
  8077. READONLY            Enables you to read only from the automatic data segment. 
  8078.  
  8079. LOADONCALL          The automatic data segment is loaded into memory as needed. 
  8080.                     This is the default. 
  8081.  
  8082. PRELOAD             The automatic data segment is loaded as soon as a process 
  8083.                     accesses a DLL. 
  8084.  
  8085. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8086. Γöé Process A Γöé                   Γöé Process B Γöé
  8087. ΓööΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ                   ΓööΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ
  8088.    Γöé     Γöé                         Γöé     Γöé
  8089.    Γöé     Γöé                         Γöé     Γöé
  8090. ΓöîΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÉ
  8091. Γöé  Γöé     Γöé       Dynamic Link      Γöé     Γöé  Γöé
  8092. Γöé  Γöé     Γöé        Functions        Γöé     Γöé  Γöé
  8093. ΓööΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÿ
  8094.    Γöé     Γöé                         Γöé     Γöé
  8095.    Γöé     Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ          Γöé     Γöé
  8096.    Γöé     Γöé      ΓöéShared Γöé          Γöé     Γöé
  8097.    Γöé     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöé Data  ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     Γöé
  8098.    Γöé            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                Γöé
  8099.    Γöé              ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ            Γöé
  8100.    Γöé              ΓöéProcess BΓöé            Γöé
  8101.    Γöé            ΓöîΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8102.    Γöé            ΓöéProcess AΓöé Γöé
  8103.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöéInstance Γö£ΓöÇΓöÿ
  8104.                 Γöé  Data   Γöé
  8105.                 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8106.  
  8107. DLL Data 
  8108.  
  8109. You also can create a DLL with both shared and instance data.  For more 
  8110. information, see Using Shared and Instance Data 
  8111.  
  8112.  
  8113. ΓòÉΓòÉΓòÉ 5.3. DLL Initialization and Termination ΓòÉΓòÉΓòÉ
  8114.  
  8115. A DLL is initialized and terminated by the default _DLL_InitTerm function. 
  8116. When a process gains access to the DLL, this function initializes the necessary 
  8117. environment for the DLL, including storage, semaphores, and variables.  When 
  8118. the process frees its access to the DLL, the _DLL_InitTerm function terminates 
  8119. the DLL environment created for that process.  The _DLL_InitTerm function is 
  8120. called automatically when you link to the DLL. 
  8121.  
  8122. The _DLL_InitTerm function can be executed once when the DLL is first loaded 
  8123. into memory, or it can be executed each time a new process first accesses the 
  8124. DLL.  The LIBRARY statement in the module-definition file is used to specify 
  8125. when the _DLL_InitTerm function is to be executed.  Following is a list of of 
  8126. the available options for the LIBRARY statement. 
  8127.  
  8128. Options             Result 
  8129.  
  8130. INITINSTANCE        The _DLL_InitTerm function is called the first time the DLL 
  8131.                     is loaded for each process that accesses the DLL. 
  8132.  
  8133. INITGLOBAL          The _DLL_InitTerm function is called only the very first 
  8134.                     time the DLL is loaded.  This is the default. 
  8135.  
  8136. TERMINSTANCE        The _DLL_InitTerm function is called the last time the DLL 
  8137.                     is freed for each process that accesses the DLL. 
  8138.  
  8139. TERMGLOBAL          The _DLL_InitTerm function is called only the final time 
  8140.                     the DLL is freed.  This is the default. 
  8141. As an example, the following statement, 
  8142.  
  8143. LIBRARY SAMPLE03 INITINSTANCE TERMINSTANCE
  8144.  
  8145. Specifying when to Execute the Initialization and Termination Function 
  8146.  
  8147. identifies the executable file as a DLL and specifies that SAMPLE03 is the name 
  8148. of the DLL.  It also specifies that the _DLL_InitTerm function is to be called 
  8149. the first time the DLL is loaded for each process that calls the DLL and the 
  8150. last time the DLL is freed for each process that calls the DLL. 
  8151.  
  8152. When OS/2 2.0 starts executing a DLL, it sets the CPU registers to known 
  8153. values, but only for 16-bit DLLs.  All 32-bit DLLs are called with a stack 
  8154. frame, like all other API calls. 
  8155.  
  8156. Initialization/termination functions can be written in a high-level language. 
  8157. For more information on writing your own initialization/termination function, 
  8158. see Creating an Initialization/Termination Function. 
  8159.  
  8160.  
  8161. ΓòÉΓòÉΓòÉ 5.4. Building DLLs ΓòÉΓòÉΓòÉ
  8162.  
  8163. Building a DLL is not very different from building a conventional static 
  8164. library.  The following sections show how you can use OS/2 tools and functions 
  8165. to create, manage, and use DLLs. 
  8166.  
  8167.  
  8168. ΓòÉΓòÉΓòÉ 5.4.1. External Function References ΓòÉΓòÉΓòÉ
  8169.  
  8170. When you compile or assemble an application, the compiler or assembler 
  8171. generates an object module for the code in the application.  If you use any 
  8172. functions that are external to your application (their code is in another 
  8173. object module), the compiler or assembler adds an external function reference 
  8174. to your application's object module. 
  8175.  
  8176. The Linker resolves these external references.  If the Linker finds the 
  8177. external function in a library called an import library or in an IMPORTS 
  8178. statement in the application's module-definition file, the code for the 
  8179. external function is in a DLL.  To resolve external references to DLLs, the 
  8180. Linker simply adds information to the executable file that tells the loader 
  8181. where to find the DLL code when the application is loaded. 
  8182.  
  8183.  
  8184. ΓòÉΓòÉΓòÉ 5.4.2. Module-Definition Files ΓòÉΓòÉΓòÉ
  8185.  
  8186. The module-definition file is an important tool for building DLLs. This file 
  8187. contains information that tells OS/2 2.0 the name of the DLL, when to load the 
  8188. DLL, how to manage memory for the DLL, and when to initialize the DLL. 
  8189.  
  8190. When you create a DLL, the module-definition file must contain a list of all 
  8191. the functions in the DLL that can be called by an application (or by another 
  8192. DLL).  You specify these external functions by using an EXPORTS statement in 
  8193. the module-definition file. 
  8194.  
  8195. You also must tell the Linker where to find the external functions in your 
  8196. application.  If the functions are in a DLL, you can use an IMPORTS statement 
  8197. in the module-definition file for the application to tell the Linker where to 
  8198. find the DLL functions.  You also can use an import library to tell the Linker 
  8199. where to find your DLL functions. 
  8200.  
  8201.  
  8202. ΓòÉΓòÉΓòÉ 5.4.3. Import Libraries ΓòÉΓòÉΓòÉ
  8203.  
  8204. A conventional library contains object modules for a number of functions. The 
  8205. library is a convenient way to manage a large number of modules and use them in 
  8206. your executable code by linking to the library.  The Linker uses the external 
  8207. references in your object module to determine which modules must be pulled out 
  8208. of the library. 
  8209.  
  8210. An import library does not contain any object modules.  Instead, the import 
  8211. library contains information that tells the Linker what DLLs are used by your 
  8212. application and the location of the functions your application uses within each 
  8213. DLL. 
  8214.  
  8215. Like a conventional library, an import library primarily is a convenience. 
  8216. Instead of specifying all the functions your application imports in its 
  8217. module-definition file, you can link with the import library and let the Linker 
  8218. resolve the external references in your object module. 
  8219.  
  8220. You use import libraries every time you compile and link a program that uses 
  8221. the OS/2 API.  All the OS/2 functions are implemented in DLLs, and OS2386.LIB 
  8222. is an import library that tells the Linker where to find each OS/2 function. 
  8223.  
  8224. For more information about module-definition files and import libraries, see 
  8225. the online Tools Reference in the OS/2 2.0 Developer's Toolkit. 
  8226.  
  8227.  
  8228. ΓòÉΓòÉΓòÉ 5.4.4. Creating a Simple DLL ΓòÉΓòÉΓòÉ
  8229.  
  8230. DLLs typically are used to provide common functions that can be used by a 
  8231. number of applications. The following figure shows a C source file, MYPUTS.C, 
  8232. for a DLL that contains a simple string-printing function. 
  8233.  
  8234. #include <os2.h>
  8235.  
  8236. #define HF_STDOUT 1  /* standard-output handle               */
  8237.  
  8238. VOID EXPENTRY myPuts(PSZ pszMsg)
  8239. {
  8240.     ULONG cbWritten;
  8241.  
  8242.     while(*pszMsg) {
  8243.         DosWrite(HF_STDOUT, pszMsg, 1, &cbWritten);
  8244.         pszMsg++;
  8245.     }
  8246.  
  8247. }
  8248.  
  8249. A Simple DLL 
  8250.  
  8251. The following figure shows the module-definition file, MYPUTS.DEF, for this 
  8252. DLL. 
  8253.  
  8254.     LIBRARY myputs
  8255.     DATA SINGLE SHARED
  8256.     EXPORTS
  8257.         myPuts
  8258.  
  8259. Module-Definition File for Simple DLL 
  8260.  
  8261. The LIBRARY statement names the DLL (MYPUTS.DLL).  The DATA statement tells the 
  8262. system that this DLL will share all data with each process that uses the DLL. 
  8263. The EXPORTS statement indicates that the function myPuts can be used by 
  8264. applications and DLLs. 
  8265.  
  8266. The DLL is compiled and linked like any application. You can use IBM's ICC and 
  8267. LINK386, as shown below, to create MYPUTS.DLL. 
  8268.  
  8269.     icc  /C+ /Ge- myputs.c
  8270.  
  8271.     link386 /noi myputs, , nul, OS2386, myputs
  8272.  
  8273. Compiling and Linking a Simple DLL 
  8274.  
  8275. When the DLL has been created, you must copy it to one of the directories 
  8276. indicated by the LIBPATH environment variable in your CONFIG.SYS file. 
  8277.  
  8278.  
  8279. ΓòÉΓòÉΓòÉ 5.4.5. Importing DLL Functions ΓòÉΓòÉΓòÉ
  8280.  
  8281. After you create a DLL, you can use it in an application. The following figure 
  8282. shows a C source file, USEPUTS.C, that uses the myPuts function contained in 
  8283. the DLL MYPUTS.DLL. 
  8284.  
  8285.     #include <os2.h>
  8286.  
  8287.     VOID EXPENTRY myPuts(PSZ);
  8288.  
  8289.     VOID main(VOID)
  8290.     {
  8291.         myPuts("Testing, 1,2,3");
  8292.     }
  8293.  
  8294. Using a Simple DLL 
  8295.  
  8296. The module-definition file for USEPUTS.C tells OS/2 2.0 where to find the 
  8297. myPuts function.  This module-definition file (USEPUTS.DEF) contains the 
  8298. information shown in The following figure 
  8299.  
  8300.     NAME useputs
  8301.     IMPORTS
  8302.         myputs.myPuts
  8303.  
  8304. DEF File for Application Using a DLL 
  8305.  
  8306. The module-definition file tells OS/2 2.0 that USEPUTS imports the myPuts 
  8307. function from MYPUTS.DLL.  USEPUTS.C is compiled and linked as shown below. 
  8308.  
  8309.     icc  /C+ useputs.c
  8310.  
  8311.     link386 /noi useputs, , nul, , useputs
  8312.  
  8313. Compiling and Linking an Application 
  8314.  
  8315.  
  8316. ΓòÉΓòÉΓòÉ 5.4.6. Using an Import Library ΓòÉΓòÉΓòÉ
  8317.  
  8318. You also can create an import library for your DLL.  If you do this, you can 
  8319. link applications with your DLL without explicitly declaring the imports for 
  8320. each application.  OS/2 2.0 uses this technique for the application programming 
  8321. interface (API).  When you link your applications with OS2386.LIB, you are 
  8322. using an import library. 
  8323.  
  8324. To create the import library STRINGS.LIB from MYPUTS.DLL, you use the Import 
  8325. Library Manager (IMPLIB), as shown below. 
  8326.  
  8327.     implib strings.lib myputs.def
  8328.  
  8329. Creating an Import Library 
  8330.  
  8331. You then can link your applications with STRINGS.LIB to resolve references to 
  8332. the myPuts function, as shown below. 
  8333.  
  8334.     link386 /noi useputs, , nul, strings;
  8335.  
  8336. Linking with an Import Library 
  8337.  
  8338. A module-definition file for USEPUTS.C is optional in this example because we 
  8339. are linking with an import library. 
  8340.  
  8341.  
  8342. ΓòÉΓòÉΓòÉ 5.4.7. Using Shared and Instance Data ΓòÉΓòÉΓòÉ
  8343.  
  8344. When you create a DLL, you can use the DATA statement in the module-definition 
  8345. file to define the default attributes for data segments within the DLL.  The 
  8346. default condition is for the DLL to have a unique copy of the automatic data 
  8347. segment for each process.  You can specify DATA MULTIPLE READWRITE in the 
  8348. module-definition file to cause OS/2 2.0 to create a separate copy of all the 
  8349. DLL data for each process that uses the DLL (instance data).  Modifications 
  8350. made by one process do not affect other processes. 
  8351.  
  8352. You also can specify different attributes for different sets of data by using 
  8353. the #pragma data_seg and #pragma alloc_text directives to define your own data 
  8354. and code segments.  You can list the segments in the module-definition file 
  8355. under the heading SEGMENTS and specify attributes for each. 
  8356.  
  8357.     SEGMENTS
  8358.        mydata SINGLE READONLY
  8359.        mycode PRELOAD
  8360.  
  8361. Specifying Data Segments with Different Attributes 
  8362.  
  8363. Any segments that you do not specify under SEGMENTS are given the attributes 
  8364. specified by the DATA or CODE statement, depending on the type of segment. 
  8365.  
  8366.  
  8367. ΓòÉΓòÉΓòÉ 5.4.8. Creating an Initialization/Termination Function ΓòÉΓòÉΓòÉ
  8368.  
  8369. It might be necessary for a DLL to perform some tasks before an application 
  8370. accesses a DLL or after an application finishes accessing a DLL.  For example, 
  8371. the library might need to allocate a heap or open a device prior to using a 
  8372. DLL, or deallocate a heap or close a device after using a DLL.  You can handle 
  8373. these tasks in an initialization/termination function.  The 
  8374. initialization/termination function can be called to perform initialization 
  8375. tasks when the DLL is first loaded or each time a new process accesses the DLL, 
  8376. depending on the LIBRARY statement in the module-definition file.  If you 
  8377. specify INITGLOBAL in the LIBRARY statement, the initialization/termination 
  8378. function is called only once, when the DLL is first loaded into memory.  This 
  8379. is the default setting.  If you specify INITINSTANCE, the library function is 
  8380. called each time the DLL is accessed by a new process.  In the same way, the 
  8381. initialization/termination function can be called on to perform termination 
  8382. tasks.  If you specify TERMGLOBAL in the LIBRARY statement, the 
  8383. initialization/termination function is called only once, the final time the DLL 
  8384. is freed.  This is the default setting.  If you specify TERMINSTANCE, the 
  8385. library function is called each time the DLL is freed for each process that 
  8386. accesses the DLL. 
  8387.  
  8388. When a thread calls DosLoadModule to load a DLL, the initialization routines of 
  8389. the loaded DLL (and the initialization routines of the DLLs that it loads) will 
  8390. run on the thread that called DosLoadModule. This initialization will complete 
  8391. before DosLoadModule returns. 
  8392.  
  8393. The prototype for the _DLL_InitTerm function is: 
  8394.  
  8395. unsigned long _DLL_InitTerm (unsigned long modhandle, unsigned long flag);
  8396.  
  8397. Prototype for the _DLL_InitTerm Function 
  8398.  
  8399. If the value of the flag parameter is 0, the DLL environment is initialized. 
  8400. If the value of the flag parameter is 1, the DLL environment is ended.  The 
  8401. modhandle parameter is the module handle assigned by the operating system for 
  8402. this DLL.  The module handle can be used as a parameter to various OS/2 API 
  8403. calls. For example, DosQueryModuleName can be used to return the 
  8404. fully-qualified path name of the DLL, which tells you where the DLL was loaded 
  8405. from. 
  8406.  
  8407. The return code from _DLL_InitTerm tells the loader whether the initialization 
  8408. or termination was performed successfully.  If the call was successful, 
  8409. _DLL_InitTerm returns a nonzero value.  A return code of 0 indicates that the 
  8410. function failed.  If a failure is indicated, the loader will not load the 
  8411. program that is accessing the DLL. 
  8412.  
  8413. Before you can call any C library functions, you must first initialize the C 
  8414. run-time environment.  To initialize the environment, use the function 
  8415. _CRT_init.  The prototype for this function is: 
  8416.  
  8417. int _CRT_init (void);
  8418.  
  8419. Prototype for the _CRT_init Function 
  8420.  
  8421. If the run-time environment is successfully initialized, _CRT_init returns 0. 
  8422. A return code of -1 indicates an error.  If an error occurs, an error message 
  8423. is written to file handle 2, which is the usual destination of stderr. 
  8424.  
  8425. To properly terminate the C run-time environment, use the function, _CRT_term. 
  8426. The prototype for this function is: 
  8427.  
  8428. void _CRT_term (unsigned long)
  8429.  
  8430. Prototype for the _CRT_term Function 
  8431.  
  8432. Because _DLL_InitTerm is called by the operating system, it must be compiled 
  8433. using the system linkage.  In the IBM C Set/2 compiler, the following #pragma 
  8434. directive is used to specify the system linkage: 
  8435.  
  8436. #pragma linkage (_DLL_InitTerm, system)
  8437.  
  8438. Specifying the System Linkage 
  8439.  
  8440. The initialization/termination function must have a specific entry point.  You 
  8441. cannot create a function with a specific entry point in the C programming 
  8442. language, so the initialization function must be written in assembly language. 
  8443. However, you can write a very simple initialization function in assembly 
  8444. language and have it immediately jump to a C function. The following figure 
  8445. shows an assembly language initialization function entry point. 
  8446.  
  8447.  
  8448.      PAGE     ,132
  8449.      TITLE    DLLSTUB
  8450.      NAME     DLLSTUB
  8451.  
  8452.      .386
  8453.      .387
  8454.  
  8455.      EXTERN   _DLL_InitTerm:NEAR
  8456.  
  8457.      END      _DLL_InitTerm
  8458.  
  8459.  
  8460. A DLL Initialization Function Entry Point 
  8461.  
  8462. The following figure shows a sample initialization/termination function written 
  8463. in C.  This code was written using the IBM C Set/2 compiler.  If you use 
  8464. another compiler, some of the #pragmas or keywords might need to be changed. 
  8465.  
  8466.  
  8467. A DLL Initialization Function
  8468.  
  8469. /*+-------------------------------------------------------------------+*/
  8470. /*| Sample Program 03 : INITTERM.C                                    |*/
  8471. /*|                                                                   |*/
  8472. /*| COPYRIGHT:                                                        |*/
  8473. /*| ----------                                                        |*/
  8474. /*| Copyright (C) International Business Machines Corp., 1991         |*/
  8475. /*|                                                                   |*/
  8476. /*+-------------------------------------------------------------------+*/
  8477.  
  8478. #include <stdlib.h>
  8479. #include <stdio.h>
  8480.  
  8481. /*+-------------------------------------------------------------------+*/
  8482. /*| _CRT_init is the C run-time environment initialization function.  |*/
  8483. /*|It will return 0 to indicate success and -1 to indicate failure.   |*/
  8484. /*+-------------------------------------------------------------------+*/
  8485.  
  8486. int _CRT_init (void);
  8487.  
  8488. /*+-------------------------------------------------------------------+*/
  8489. /*| _CRT_term is the C run-time environment termination function.     |*/
  8490. /*+-------------------------------------------------------------------+*/
  8491.  
  8492. void _CRT_term (unsigned long);
  8493.  
  8494. size_t nSize;
  8495. int *pArray;
  8496.  
  8497. /*+-------------------------------------------------------------------+*/
  8498. /*| _DLL_InitTerm is the function that gets called by the operating   |*/
  8499. /*| system loader when it loads and frees this DLL for each process   |*/
  8500. /*| that accesses this DLL.  However, it only gets called the first   |*/
  8501. /*| time the DLL is loaded and the last time it is freed for a        |*/
  8502. /*| particular process.  The system linkage convention must be used   |*/
  8503. /*| because the operating system loader is calling this function.     |*/
  8504. /*+-------------------------------------------------------------------+*/
  8505.  
  8506. #pragma linkage (_DLL_InitTerm, system)
  8507.  
  8508. unsigned long _DLL_InitTerm (unsigned long modhandle, unsigned long flag)
  8509.    {
  8510.    size_t i;
  8511.  
  8512.    /* If flag is zero then the DLL is being loaded so initialization  */
  8513.    /* should be performed.  If flag is 1 then the DLL is being freed  */
  8514.    /* so termination should be performed.                             */
  8515.  
  8516.    switch (flag)
  8517.       {
  8518.       case 0:
  8519.          /* The C run-time environment initialization function must   */
  8520.          /* be called before any calls to C run-time functions that   */
  8521.          /* are not inlined.                                          */
  8522.  
  8523.          if (_CRT_init () == -1)
  8524.             return 0UL;
  8525.  
  8526.          srand (17);
  8527.  
  8528.          nSize = (rand() % 128) + 32;
  8529.  
  8530.          printf ("The array size for this process is %u\n",nSize);
  8531.  
  8532.          if ((pArray=malloc (nSize * sizeof(int)))==NULL)
  8533.             {
  8534.             printf("Could not allocate space for unsorted array.\n");
  8535.             return 0UL;
  8536.             }
  8537.  
  8538.          for (i=0; i<nSize; ++i)
  8539.             pArray[i] = rand();
  8540.  
  8541.          break;
  8542.  
  8543.       case 1:
  8544.          printf("The array will now be freed.\n");
  8545.  
  8546.          free(pArray);
  8547.  
  8548.          _CRT_term(0UL);
  8549.  
  8550.          break;
  8551.  
  8552.       default:
  8553.          printf("flag = %lu\n",flag);
  8554.          return 0UL;
  8555.  
  8556.       }
  8557.  
  8558.    /* A nonzero value must be returned to indicate success. */
  8559.    return 1UL;
  8560.  
  8561.    }
  8562.  
  8563. You also can write the initialization/termination function entirely in assembly 
  8564. language, without jumping to a C function.  For this case, the library 
  8565. initialization registers are defined as follows: 
  8566.  
  8567. EIP            Library entry address 
  8568.  
  8569. ESP            User program stack 
  8570.  
  8571. CS             Code selector for base of linear address space 
  8572.  
  8573. DS=ES=SS       Data selector for base of linear address space 
  8574.  
  8575.                Note:  All 32-bit protected memory library modules will be given 
  8576.                a GDT selector in the DS and ES registers (ProtDS) that 
  8577.                addresses the full linear address space available to an 
  8578.                application.  This selector should be saved by the 
  8579.                initialization routine.  Non-protected memory library modules 
  8580.                will receive a selector (FlatDS) that addresses the same amount 
  8581.                of linear address space as an application's EXE file. 
  8582.  
  8583. FS             Data selector of the base of the Thread Information Block (TIB) 
  8584.  
  8585. GS             Is equal to 0 
  8586.  
  8587. EAX=EBX        Is equal to 0 
  8588.  
  8589. ECX=EDX        Is equal to 0 
  8590.  
  8591. ESI=EDI        Is equal to 0 
  8592.  
  8593. EBP            Is equal to 0 
  8594.  
  8595. [ESP+0]        Return address to system, and EAX = return code 
  8596.  
  8597. [ESP+4]        Module handle for the library module 
  8598.  
  8599. [ESP+8]        Is equal to 0 (for initialization) 
  8600. A 32-bit library can specify that its entry point address is the 16-bit object 
  8601. code.  In this case, the entry registers are the same as for entry to a library 
  8602. using the segmented EXE format.  This means that a 16-bit library can be 
  8603. relinked to take advantage of the benefits of the linear EXE format (such as 
  8604. more efficient paging). 
  8605.  
  8606. The library termination registers are defined as follows: 
  8607.  
  8608. EIP            Library entry address 
  8609.  
  8610. ESP            User program stack 
  8611.  
  8612. CS             Code selector for the base of the linear address space 
  8613.  
  8614. DS=ES=SS       Data selector for the base of the linear address space 
  8615.  
  8616. FS             Data selector of the base of the Thread Information Block (TIB) 
  8617.  
  8618. GS             Is equal to 0 
  8619.  
  8620. EAX=EBX        Is equal to 0 
  8621.  
  8622. ECX=EDX        Is equal to 0 
  8623.  
  8624. ESI=EDI        Is equal to 0 
  8625.  
  8626. EBP            Is equal to 0 
  8627.  
  8628. [ESP+0]        Return address to the system 
  8629.  
  8630. [ESP+4]        Module handle for the library module 
  8631.  
  8632. [ESP+8]        Is equal to 1 (for termination) 
  8633.  
  8634. Note:  Library termination is not permitted for libraries with 16-bit entries 
  8635.  
  8636.  
  8637. ΓòÉΓòÉΓòÉ 5.4.9. Linking at Runtime ΓòÉΓòÉΓòÉ
  8638.  
  8639. So far, the examples in this chapter have used load-time dynamic linking. With 
  8640. load-time linking,  OS/2 2.0 loads the DLL containing the imported functions 
  8641. when it loads the EXE file.  If OS/2 2.0 cannot find the necessary DLL, it 
  8642. terminates the application and reports the error. 
  8643.  
  8644. Run-time dynamic linking permits an application to load a DLL into memory when 
  8645. it is required, and to remove the DLL when it is no longer needed. The 
  8646. application uses the DosLoadModule function to load the DLL into memory (if it 
  8647. is not loaded already).  If the system cannot find the DLL, the application 
  8648. receives an error value and can take appropriate action. For example, the 
  8649. application might use another DLL or search another directory. 
  8650.  
  8651. Once the application has loaded the DLL, it can use the DosQueryProcAddr 
  8652. function to obtain a pointer to the required function (or functions). The 
  8653. application then can use the function.  When the DLL is no longer required, the 
  8654. application can use the DosFreeModule function to remove the DLL from memory. 
  8655. If there are other applications using the DLL, it remains in memory until the 
  8656. last application frees the DLL. 
  8657.  
  8658. An application can specify a full path for the run-time DLL. If you specify the 
  8659. full path name, you can have two DLLs with the same name loaded at the same 
  8660. time, as in C:\OS2\DLLFILE.DLL and C:\OS2\DLL\DLLFILE.DLL. If the path is not 
  8661. specified, OS/2 2.0 assumes the DLL has the extension .DLL and looks for the 
  8662. file in the directories specified by the LIBPATH environment variable. 
  8663.  
  8664. The following figure uses the run-time dynamic-linking functions to access the 
  8665. myPuts function in the MYPUTS.DLL dynamic link library. 
  8666.  
  8667.     #define INCL_DOSMODULEMGR
  8668.     #include <os2.h>
  8669.  
  8670.     VOID (* EXPENTRY myPuts) (PSZ);
  8671.  
  8672.     VOID main(VOID)
  8673.     {
  8674.         HMODULE hmod;
  8675.         ULONG ulErr;
  8676.         UCHAR szFailName[CCHMAXPATH];
  8677.  
  8678.         ulErr = DosLoadModule(szFailName,          /* failed module name */
  8679.             sizeof(szFailName),                    /* size of buffer     */
  8680.             "myputs",                              /* name of DLL        */
  8681.             &hmod);                                /* module handle here */
  8682.  
  8683.         if (ulErr)
  8684.             DosExit(EXIT_PROCESS, 1);
  8685.  
  8686.         ulErr = DosQueryProcAddr(hmod,    /* DLL module handle           */
  8687.             0,                            /* function ordinal value      */
  8688.             "myPuts",                     /* function name               */
  8689.             (PFN *) &myPuts);             /* address of function pointer */
  8690.  
  8691.         if (!ulErr) {
  8692.  
  8693.             /* We can use the function now. */
  8694.  
  8695.             myPuts("does it work?");
  8696.  
  8697.             DosFreeModule(hmod);                 /* frees the DLL module */
  8698.         }
  8699.     }
  8700.  
  8701. Using A Run-Time Dynamically Linked Library 
  8702.  
  8703.  
  8704. ΓòÉΓòÉΓòÉ 5.5. Protected Memory Use ΓòÉΓòÉΓòÉ
  8705.  
  8706. OS/2 2.0 provides shared library support in the form of 32-bit DLLs.  All 
  8707. 32-bit dynamic links or APIs are called using near CALL or RET instructions, so 
  8708. the cost of making dynamic-link calls should be significantly less than the 
  8709. cost of making the comparable calls in the 16-bit version of the operating 
  8710. system, where a far CALL is required.  The DLLs execute in the context of the 
  8711. caller. 
  8712.  
  8713. All 32-bit DLLs are mapped into the appropriate shared memory region of the 
  8714. requesting processes at load time and execute at ring 3 without IOPL.  This 
  8715. model's protection characteristics correspond closest to the ring 3 
  8716. dynamic-linking model in the 16-bit version of the operating system. The 
  8717. following figure shows how 32-bit DLLs are implemented in the linear memory 
  8718. model of OS/2 2.0. 
  8719.  
  8720.   4GΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8721.     Γöé System Area  Γöé
  8722. 512MΓö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8723.     Γöé              Γöé
  8724.     Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8725.     Γöé  32 Bit DLL  Γöé
  8726.     Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8727.     Γöé       Γöé     Γöé
  8728.     Γöé     Γöé  Γöé     Γöé
  8729.     Γöé CallΓöé  ΓöéRet  Γöé
  8730.     ΓöéNear Γöé  ΓöéNear Γöé
  8731.     Γöé     Γöé  Γöé     Γöé
  8732.     Γöé     Γöé  Γöé     Γöé
  8733.     Γöé     Γöé       Γöé
  8734.     Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8735.     Γöé  32 Bit EXE  Γöé
  8736.     Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8737.     Γöé              Γöé
  8738.    0ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8739.  
  8740. A 32-Bit DLL 
  8741.  
  8742. However, since 32-bit EXE programs can address the entire address space with a 
  8743. 32-bit offset, it is easier for a 32-bit application programmer to potentially 
  8744. cast a bad pointer to data in the shared region than in the 16-bit segmented 
  8745. addressing scheme.  Since many subsystems have semaphores and other shared data 
  8746. structures in the shared region, the potential for an inadvertently errant 
  8747. application to affect another process sharing a subsystem becomes an issue in 
  8748. the flat environment.  Therefore, OS/2 2.0 provides a mechanism for DLLs to 
  8749. protect their critical shared global data regions from 32-bit EXEs.  This 
  8750. mechanism prevents a thread in one process from potentially affecting other 
  8751. processes using the same resources (subsystems), or potentially taking down the 
  8752. entire workstation if the compromised subsystem is critical (such as PM). 
  8753.  
  8754. OS/2 2.0 enables existing 16-bit DLLs and new 32-bit DLLs to get their shared 
  8755. global data allocated into a single protected region that is not accessible by 
  8756. 32-bit EXEs, thereby achieving a level of protection.  There is no provision 
  8757. for protecting DLLs from each other or from threads executing 16-bit EXE 
  8758. modules.  The MEMMAN CONFIG.SYS line supports a "PROTECT/NOPROTECT" option, as 
  8759. follows, for enabling or disabling memory protection: 
  8760.  
  8761. MEMMAN=SWAP,PROTECT
  8762.  
  8763. Enabling Memory Protection for DLLs 
  8764.  
  8765. If neither PROTECT nor NOPROTECT is specified, the default is protection 
  8766. enabled (PROTECT). 
  8767.  
  8768. When protection is enabled, the memory manager reserves a 64M region of the 
  8769. linear address space below the 512MB line; this is called the protected region. 
  8770. Protected objects are allocated within the protected region.  The following 
  8771. types of memory are considered protected: 
  8772.  
  8773. DLL Global Data          Global data that is part of the DLL image when loaded. 
  8774.                          This is only global shared data, not instance data. 
  8775.                          Although DLL code is shared, it is not allocated in 
  8776.                          the protected region since it is read-only. 
  8777.  
  8778. DLL Run-Time Shared Data Global data that is allocated at runtime by a thread 
  8779.                          executing in DLL code that is a protected API.  This 
  8780.                          includes 16- and 32-bit, named and unnamed, shared 
  8781.                          memory, and shared memory allocated with DosAllocSeg 
  8782.                          with the share flag set. 
  8783.  
  8784. The DS value that is used for the user address space (FlatDS) no longer 
  8785. references a descriptor with a 512MB limit.  Instead the system exports another 
  8786. DS value for the user address space called the ProtDS that does have the 512MB 
  8787. limit-the FlatDS limit is reduced by the size of the protected region.  When a 
  8788. 32-bit EXE is executing, it runs with the FlatDS and is unable to access 
  8789. protected objects created by 16-bit, 32-bit, or 16- and 32-bit DLLs.  If the 
  8790. thread calls a 16-bit DLL API entry point, the DLL will have addressability to 
  8791. the protected region through the LDT.  If the thread calls a 32-bit DLL entry 
  8792. point that is protected, the 32-bit DLL entry point contains code to switch to 
  8793. the ProtDS so that the protected region is accessible-the 32-bit DLL switches 
  8794. back to the FlatDS before completing service. A switch on the C compiler is 
  8795. used to generate the code sequence as shown in the following figure. 
  8796.  
  8797. DLLAPI  proc
  8798.     push    ds
  8799.     push    es
  8800.     mov     dx, seg FLAT:DGROUP
  8801.     mov     ds, dx
  8802.     mov     es, dx
  8803.  
  8804.     .....
  8805.  
  8806.     pop     es
  8807.     pop     ds
  8808.     ret
  8809. DLLAPI  endp
  8810.  
  8811. Accessing Protected DLL Data 
  8812.  
  8813. Although SS is not loaded with the ProtDS, a subsystem that switches stacks to 
  8814. a protected stack must write some assembler code to change ESP-thus the 
  8815. subsystem also should set up SS to be the ProtDS when performing the stack 
  8816. switch. 
  8817.  
  8818. When protection is not enabled, FlatDS=ProtDS and the code still works the 
  8819. same. 
  8820.  
  8821. Note:  The system currently is not sensitive to whether parameters are being 
  8822. validated relative to the FlatDS or the ProtDS when ring 0 kernel APIs are 
  8823. called.  Also the 3216 thunks do not probe 32-bit parameters before converting 
  8824. them and passing them to a 16-bit DLL. 
  8825.  
  8826. The grouping of protected allocations can be enabled or disabled on a per DLL 
  8827. basis.  For 32-bit DLLs, the Linker uses the PROTECT parameter in the DEF file 
  8828. to provide protection information in the DLL's module flags to the loader.  All 
  8829. 16-bit modules requiring protection must be specified with the new PROTECT16 
  8830. CONFIG.SYS parameter. 
  8831.  
  8832. PROTECT16=DLLNAME1,DLLNAME2,...,DLLNAMEX
  8833.  
  8834. Using the PROTECT16 Parameter 
  8835.  
  8836. Notice that the DLL suffix is not required.  Only DLL files can get the 
  8837. protection. 
  8838.  
  8839.  
  8840. ΓòÉΓòÉΓòÉ 5.6. DLL Side Effects ΓòÉΓòÉΓòÉ
  8841.  
  8842. Dynamic link routines are not processes.  They run on the thread of the calling 
  8843. process and therefore do not own resources.  Any resource that they obtain or 
  8844. use is owned by the calling process.  Authors of DLLs should be careful not to 
  8845. needlessly allocate resources until the resource is required by the calling 
  8846. process to perform the requested function. They also should free the resource 
  8847. as soon as that resource is no longer required. 
  8848.  
  8849. A dynamic link routine that obtains and uses resources should attempt to 
  8850. minimize the use of a process's resources.  For example, stack space should be 
  8851. conserved. If an application redirects file handle 5 and calls a DLL entry that 
  8852. expects file handle 5 to be an open handle to an associated device driver, 
  8853. unpredictable results can occur. 
  8854.  
  8855. If the routine opens an abundance of file handles, it might consider increasing 
  8856. the maximum number of file handles, so that the process maximum is not 
  8857. exceeded.  However, increasing the maximum number of file handles for a process 
  8858. also increases the maximum number of file handles for all processes created by 
  8859. the current process.  This will cause additional memory to be consumed and 
  8860. could cause problems for an application that assumes a limit of 20 file 
  8861. handles. Also, it should be noted that applications have the ability to 
  8862. redirect file handles. 
  8863.  
  8864. Dynamic link routines also should not make system calls that affect the calling 
  8865. process environment.  If a DLL changes a process's current directory, another 
  8866. thread running under the same process could fail a file I/O call if it assumes 
  8867. a given working directory. 
  8868.  
  8869. Applications and DLLs should not make calls to other DLLs, including system 
  8870. DLLs, within a critical section.  Since DLLs can use semaphores to synchronize 
  8871. threads within a process or between processes, calling a DLL within a critical 
  8872. section could cause application deadlocks. This would occur if the DLL requests 
  8873. a semaphore on behalf of the calling thread and another thread within the 
  8874. process owns the semaphore.  Because the calling thread is in a critical 
  8875. section and is the only thread within the process that is permitted to execute, 
  8876. the semaphore will never be freed, causing a deadlock. 
  8877.  
  8878.  
  8879. ΓòÉΓòÉΓòÉ 5.7. Summary ΓòÉΓòÉΓòÉ
  8880.  
  8881. There are two types of linking: static and dynamic.  Static linking enables a 
  8882. program's code and data to be contained in a single executable file, enabling 
  8883. the system to load it all into memory at once.  Dynamic linking permits several 
  8884. applications to use a single copy of an executable module, since the executable 
  8885. module is completely separate from the applications that use it. 
  8886.  
  8887. The advantages of dynamic linking are: 
  8888.  
  8889. o Reduced memory requirements 
  8890. o Simplified application modification 
  8891. o Flexible software support 
  8892. o Transparent migration of functions 
  8893. o Multiple programming language support 
  8894. o Application controlled memory usage. 
  8895.  
  8896. OS/2 2.0 provides two types of dynamic linking: load-time and run-time.  In 
  8897. load-time dynamic linking, an application is linked with a library file that 
  8898. contains a record that describes where the routine can be found instead of a 
  8899. file that contains the code for the routine.  The DLL can be loaded as soon as 
  8900. a process accesses the DLL or when needed.  In run-time dynamic linking, the 
  8901. EXE for an application does not contain a record describing where the external 
  8902. routines can be found.  Instead, the application explicitly tells OS/2 2.0 when 
  8903. to load and free the dynamic link module. 
  8904.  
  8905. DLL data can be shared or not shared by all processes that use it. 
  8906.  
  8907.  
  8908. ΓòÉΓòÉΓòÉ 6. Multiple Virtual DOS Sessions ΓòÉΓòÉΓòÉ
  8909.  
  8910. This chapter describes: 
  8911.  
  8912. o The differences between the OS/2 1.X real mode DOS Box and the 2.0 Enhanced 
  8913.   DOS Session 
  8914. o Virtual device driver (VDD) architecture and how the behavior of VDDs is 
  8915.   affected by Enhanced DOS Session operations. 
  8916.  
  8917.  
  8918. ΓòÉΓòÉΓòÉ 6.1. Overview ΓòÉΓòÉΓòÉ
  8919.  
  8920. Since the introduction of OS/2 Version 1.0 in 1987, the DOS compatibility mode 
  8921. has remained relatively unchanged.  The 16-bit OS/2 DOS Mode, based on the 
  8922. 80286 architecture, runs as a real-mode task inside the protect-mode 
  8923. environment of Version 1.X of the operating system. Enhanced DOS Sessions in 
  8924. OS/2 2.0 is a totally redesigned DOS-compatible environment, which extends the 
  8925. DOS compatibility features of the operating system by exploiting the virtual 
  8926. 8086 mode of the 80386 and 80486, resulting in a better implementation of DOS. 
  8927. Most users considering a switch to OS/2 2.0 demand that the operating system 
  8928. provide a DOS-compatible environment to run their favorite DOS applications. 
  8929. OS/2 2.0 enables users to not only use their DOS applications but also to have 
  8930. multiple DOS sessions running concurrently. 
  8931.  
  8932. With a design based on the virtual 8086 mode, OS/2 2.0 maintains a protected 
  8933. system environment, even while running DOS applications.  This enhances system 
  8934. integrity and makes it possible to multitask DOS applications with OS/2 
  8935. applications, so DOS programs can continue to execute in the background.  OS/2 
  8936. 2.0 also permits DOS applications to display in windows under the control of 
  8937. PM. 
  8938.  
  8939.  
  8940. ΓòÉΓòÉΓòÉ 6.2. Enhanced DOS Session ΓòÉΓòÉΓòÉ
  8941.  
  8942. Version 1.X of the OS/2 operating system is based on the capabilities of the 
  8943. 80286 processor; therefore, the only practical way to run a DOS application is 
  8944. as a real-mode task.  Primarily this is because, in the 16-bit version of the 
  8945. operating system, DOS applications address code and data in memory using a 
  8946. segment:offset address format, based on the earlier 8088/8086 processors.  OS/2 
  8947. applications, however, are written to run in protect mode and use the 
  8948. selector:offset address format.  To run a DOS application simultaneously with 
  8949. many OS/2 applications, the system switches between real mode and protect mode 
  8950. as necessary. OS/2 2.0 is designed to fully exploit the advanced features of 
  8951. the 80386 processor.  A major innovation in the 80386 is support for executing 
  8952. multiple 8086 (or 8088) tasks within the 80386 protect-mode environment.  An 
  8953. 8086 task in this environment is called a virtual 8086 (V86) task.  In OS/2 
  8954. 2.0, this V86 task is a DOS session, which runs as a single-threaded V86 mode 
  8955. process.  Each DOS session in OS/2 2.0 is managed as a single-process session. 
  8956. The OS/2 scheduler controls task-switching in much the same way as an OS/2 
  8957. application process. 
  8958.  
  8959. The following figure is a comprehensive view of the OS/2 2.0 structure with the 
  8960. Enhanced DOS Session kernel and VDDs shown in relation to the OS/2 kernel and 
  8961. physical device drivers (PDD). Key components of the OS/2 and Enhanced DOS 
  8962. Session kernel are shown, with a schematic of how these components interact 
  8963. with each other. Following is a description of some of these key components: 
  8964.  
  8965. DOS Session:  The instance of a single virtual 8086 mode process running on an 
  8966. 80386 or 80486 processor that is emulating all DOS operating system functions 
  8967. and providing a compatible environment.  Several Enhanced DOS Sessions can be 
  8968. multitasked using the task-switching features of the 80386 and compatibles. 
  8969.  
  8970. Enhanced DOS Session Kernel:  Composed of the following three major components, 
  8971. the Enhanced DOS Session kernel controls the state and operation of multiple 
  8972. DOS Mode sessions.  (The actual number of sessions you can create depends on 
  8973. the amount of space you have available on your swapfile partition; if you have 
  8974. enough space available, you might be able to create more than 50 sessions.) 
  8975.  
  8976. o DOS Session Manager: Creates, initializes, and terminates DOS sessions.  It 
  8977.   provides various system services to VDDs, known as Virtual Device Helper 
  8978.   (DevHlp) functions. The DOS Session Manager manages system resources (that 
  8979.   is, memory, timers, semaphores, files) for all DOS sessions. 
  8980.  
  8981. o 8086 Emulation:  Performs 8086 instruction decoding, controls the 80386 
  8982.   processor's I/O Privilege Map for each DOS session, manages the reflection of 
  8983.   software interrupts for each DOS session, routes IN/OUT instruction traps to 
  8984.   the appropriate VDDs, and manages the various control structures required by 
  8985.   each VDD. 
  8986.  
  8987. o DOS Emulation:  Emulates the function and operation of DOS on a 
  8988.   per-DOS-session basis.  Each DOS session emulates an entirely independent 
  8989.   instance of DOS.  DOS services are emulated within the Enhanced DOS Session 
  8990.   kernel or by invoking protect-mode services provided by the OS/2 kernel. For 
  8991.   example, most DOS file I/O functions are provided by the OS/2 File System. 
  8992.  
  8993. Virtual Device Driver (VDD):  A VDD emulates an aspect of system function, 
  8994. typically I/O, and manages the way multiple DOS sessions access hardware I/O 
  8995. services. VDDs obtain and release system resources by way of the Virtual DevHlp 
  8996. services provided by the Enhanced DOS Session kernel.  A VDD can access an I/O 
  8997. control device directly or can perform I/O through a PDD, using a direct-call 
  8998. interface.  A VDD also can simulate hardware interrupts into one or many DOS 
  8999. session processes.  Finally, a VDD can provide the logic to emulate BIOS and 
  9000. other software interrupt functions. 
  9001.  
  9002. With the following figure as a point of reference, the following information 
  9003. highlights the advantages of Enhanced DOS Session and how OS/2 2.0 provides an 
  9004. improved DOS-compatibility environment. 
  9005.  
  9006. Enhanced DOS Session System Structure and Control Flow 
  9007.  
  9008.  
  9009. ΓòÉΓòÉΓòÉ 6.2.1. Fast Mode Switching ΓòÉΓòÉΓòÉ
  9010.  
  9011. As mentioned previously, Version 1.X of the operating system is based on the 
  9012. 80286 processor.  This processor can switch from real mode to protect mode, 
  9013. although this takes many CPU cycles. However, it has no provision for switching 
  9014. directly back to real mode. Switching back to real mode requires reinitializing 
  9015. the processor-in effect, setting it to an initial power-on state.  This must be 
  9016. done while preserving all the system control information, all process contexts, 
  9017. and system resource states.  Thus, switching frequently between real mode, 
  9018. (where a DOS program is executing) and protect mode (where several OS/2 
  9019. programs might be running), generates a significant level of system overhead. 
  9020.  
  9021. Mode-switching overhead is reduced on the 80386, where a single instruction 
  9022. switches the system quickly from real mode to protect mode and back again. 
  9023. Although this saves time, mode switching still requires significant overhead 
  9024. and is avoided whenever possible.  For example, nearly all OS/2 1.X device 
  9025. driver code is bi-modal.  That is, the device driver is written so that it can 
  9026. be entered in either protect mode or real mode.  An OS/2 bi-modal device driver 
  9027. will force a mode switch only when it is absolutely necessary, such as when it 
  9028. is running in real mode, but it must move data to a protect-mode OS/2 
  9029. application's virtual address space.  When a DOS application is running while 
  9030. OS/2 applications run in the background, mode switching occurs.  The overhead 
  9031. of mode switching can degrade system performance in these scenarios. 
  9032.  
  9033. OS/2 2.0 DOS sessions, on the other hand, are based on the virtual 8086 mode of 
  9034. the 80386 and 80486 processors.  The virtual 8086 mode is a superset of protect 
  9035. mode, which is enabled by setting the VM bit in the EFLAGS register of the 
  9036. 80386.  The CPU provides hardware support to switch automatically into V86 mode 
  9037. on a task switch when the new task sets the VM bit in the EFLAGS register. 
  9038. Because of this and other hardware support mechanisms, most of the operating 
  9039. system overhead associated with mode switching has been eliminated.  When 
  9040. switching between V86 mode (DOS application) and protect mode (OS/2 application 
  9041. or system code), the 80386 hardware automatically activates the appropriate 
  9042. protection mechanisms. 
  9043.  
  9044. Real-mode execution has been totally eliminated in OS/2 2.0. This makes it 
  9045. possible to remove all real mode-specific code from device drivers and kernel 
  9046. modules, which were bi-modal in previous versions of the operating system. 
  9047. With OS/2 2.0, device drivers are written as purely protect-mode executables. 
  9048. This simplifies the logic and reduces the size of the affected modules. 
  9049.  
  9050. The OS/2 operating system provides each protect-mode process with its own 
  9051. independent address space for code and data objects.  This protects the code 
  9052. and data objects from other applications.  It also helps prevent errant 
  9053. applications from causing a system crash, since system-owned resources are 
  9054. accessible only by system code.  This high level of protection, a major feature 
  9055. of the OS/2 operating system not found in DOS, improves the integrity and 
  9056. reliability of the system. 
  9057.  
  9058. Under Version 1.X of the operating system, when the OS/2 operating system 
  9059. switches into real mode, a DOS application can directly access any object in 
  9060. memory between 0 and 1MB, including portions of the OS/2 kernel and device 
  9061. drivers.  A DOS program that inadvertently accesses any of the system's code or 
  9062. data objects can disrupt the system.  In addition, a DOS program can directly 
  9063. access any I/O device hardware and cause the device to enter an unknown state. 
  9064. This can render the device useless in the OS/2 protect-mode environment and 
  9065. cause the OS/2 device driver to fail.  These problems eventually might lead to 
  9066. a system crash and the loss of user data, which often accompanies such events. 
  9067.  
  9068. By running DOS applications as V86-mode tasks, OS/2 2.0 maintains a fully 
  9069. protected system environment.  Each DOS program runs in its own linear 1MB 
  9070. memory space.  This space is separately allocated from system memory with full 
  9071. protection guaranteed by the 80386.  A DOS program cannot corrupt any system 
  9072. code, data object, or another application's code or data.  If the V86 task 
  9073. causes a trap or exception, it will be fully managed by the operating system to 
  9074. maintain integrity.  An unpredictable DOS program can be terminated cleanly by 
  9075. the system in much the same way as an unpredictable OS/2 application. 
  9076.  
  9077. The system selectively isolates the DOS applications from I/O devices that are 
  9078. managed exclusively by OS/2 device drivers.  These devices are then emulated, 
  9079. or virtualized, for one or more DOS applications.  New to OS/2 2.0, the VDD 
  9080. provides each DOS application with a virtual instance of the real hardware, 
  9081. which is controlled by a PDD.  If necessary for performance or other reasons, a 
  9082. VDD-PDD pair can cooperate to give the DOS program direct access to a 
  9083. particular I/O port or range of ports.  By controlling hardware access in this 
  9084. way, DOS applications cannot corrupt devices that are performing I/O functions 
  9085. for an OS/2 process. 
  9086.  
  9087.  
  9088. ΓòÉΓòÉΓòÉ 6.2.2. Multiple DOS Sessions ΓòÉΓòÉΓòÉ
  9089.  
  9090. In OS/2 2.0, Enhanced DOS Session makes it possible to start many concurrent 
  9091. DOS sessions, each operating in its own independent 1MB linear address space. 
  9092. The number of sessions is limited only by the amount of memory and swap space. 
  9093. This brings true multiprogramming to the OS/2 DOS-compatibility environment. 
  9094. The user can run multiple DOS programs in much the same way as running multiple 
  9095. OS/2 applications. DOS and OS/2 applications are started in the same ways, for 
  9096. example, from a command prompt or from the Desktop. 
  9097.  
  9098.  
  9099. ΓòÉΓòÉΓòÉ 6.2.3. DOS Settings ΓòÉΓòÉΓòÉ
  9100.  
  9101. To provide the highest possible level of compatibility with DOS applications, 
  9102. Enhanced DOS Session gives the user the ability to customize the operation of 
  9103. the DOS environment through DOS Settings.  DOS Settings enable the user to 
  9104. control particular DOS properties or attributes that affect the behavior of DOS 
  9105. applications running in a DOS session.  DOS applications typically are not 
  9106. careful about consuming system resources, such as memory and processor time. 
  9107. To preserve the integrity and performance of the system as a whole, Enhanced 
  9108. DOS Session provides a flexible environment for these applications by 
  9109. permitting the user to configure a DOS session for DOS applications that 
  9110. otherwise might not work well (or not work at all) with the default settings of 
  9111. the DOS session task. 
  9112.  
  9113. Enhanced DOS Session provides a mechanism that supports standard settings and 
  9114. enables VDDs to register custom settings.  The CONFIG.SYS file contains a 
  9115. number of standard DOS Settings.  These are applied to all DOS sessions as they 
  9116. are created; however, these settings can be changed for individual sessions. 
  9117.  
  9118. DOS Settings can be set by the user when adding an application to a group on 
  9119. the Desktop or, in certain cases, during execution while an application is 
  9120. running within the DOS session.  In a case where a DOS session is created by 
  9121. another process using the DosStartSession function, a buffer can be provided 
  9122. containing the required DOS Settings and their values. 
  9123.  
  9124. The standard DOS Settings that affect the operation of VDDs supplied with OS/2 
  9125. 2.0 can be categorized as follows: 
  9126.  
  9127. Video                    Controls functioning of screen I/O operations within a 
  9128.                          DOS session. 
  9129.  
  9130. Hardware Environment     Affects the virtual hardware environment provided by 
  9131.                          the DOS session. 
  9132.  
  9133. DOS Environment          Affects the behavior of the DOS emulation environment 
  9134.                          within a DOS session. 
  9135.  
  9136. Memory Extenders         Affects the behavior of the EMS, XMS, and DPMI memory 
  9137.                          extenders, if used in the DOS session. 
  9138.  
  9139. File Operations          Affects the behavior of file I/O operations within a 
  9140.                          DOS session. 
  9141.  
  9142. Windowing                Affects the screen I/O behavior of DOS sessions when 
  9143.                          running in windowed mode on the Desktop. 
  9144.  
  9145.  
  9146. ΓòÉΓòÉΓòÉ 6.2.4. Transfer of Data Between DOS Sessions ΓòÉΓòÉΓòÉ
  9147.  
  9148. To permit easy migration of data from DOS applications to PM applications, OS/2 
  9149. 2.0 enables DOS programs to run within windows in the Desktop environment. 
  9150. This enables users to display a graph or chart from a DOS application beside a 
  9151. document they are preparing with an OS/2 word processor.  A block of text can 
  9152. be selected in one window (a popular DOS word processor, for example) and 
  9153. copied to the clipboard using a mouse or keyboard.  That text can be pasted 
  9154. into another window (perhaps a PM spreadsheet application).  Graphic images 
  9155. also can be transferred from a DOS application to the clipboard. 
  9156.  
  9157.  
  9158. ΓòÉΓòÉΓòÉ 6.2.5. Increased Available Memory ΓòÉΓòÉΓòÉ
  9159.  
  9160. The small memory space availability in Version 1.X of the OS/2 prevents some 
  9161. DOS applications from loading.  Since the operating system installs some of its 
  9162. kernel, device driver code, and data in fixed memory below 1MB (so system 
  9163. functions can execute in real mode), DOS applications have less space for their 
  9164. own code and data. 
  9165.  
  9166. Note:  This problem is not unusual, even in a native DOS environment, since 
  9167.        installing memory-resident DOS programs and device drivers have the same 
  9168.        effect. 
  9169.  
  9170. In OS/2 2.0, the available base memory (below 640KB) in each DOS session is 
  9171. over 620KB, before loading any user-installed DOS device drivers or 
  9172. Terminate-and-Stay-Resident (TSR) programs.  This increases the available base 
  9173. memory in OS/2 2.0 by nearly 80KB over Version 1.3.  Since the available base 
  9174. memory is greater than in DOS itself, OS/2 users are now able to load some DOS 
  9175. TSR programs with larger DOS applications, which would not fit together in the 
  9176. smaller base memory available in DOS. 
  9177.  
  9178. Adding LAN drivers to the OS/2 configuration to support the network server or 
  9179. redirector functions does not take up DOS application space. Any user-installed 
  9180. OS/2 device drivers will not affect the amount of application space available 
  9181. to a DOS application running under Enhanced DOS Session. 
  9182.  
  9183.  
  9184. ΓòÉΓòÉΓòÉ 6.2.6. Memory Extender Support ΓòÉΓòÉΓòÉ
  9185.  
  9186. Many popular DOS applications are now using the Expanded Memory Specification 
  9187. (EMS) or the Extended Memory Specification (XMS) to access memory in protect 
  9188. mode on the 80286 or 80386 processors.  This permits DOS applications to access 
  9189. memory above the 1MB real-mode addressing limit, to have total code and data 
  9190. space larger than the available base memory, and to have very large code or 
  9191. data objects loaded into memory for enhanced execution speed.  The standard 
  9192. configuration of OS/2 2.0 Enhanced DOS Session supports both the EMS and XMS 
  9193. functions. 
  9194.  
  9195.  
  9196. ΓòÉΓòÉΓòÉ 6.2.6.1. Expanded Memory Specification ΓòÉΓòÉΓòÉ
  9197.  
  9198. OS/2 2.0 EMS support is based on Lotus**-Intel-Microsoft (LIM) EMS Version 4.0. 
  9199. Under DOS, special hardware normally is required to support EMS, although a 
  9200. number of software-based EMS emulation packages exist.  Enhanced DOS Session 
  9201. supports EMS by mapping memory allocation requests into the linear process 
  9202. address space using normal system memory.  No special hardware or software is 
  9203. required.  The underlying OS/2 virtual memory management functions provide the 
  9204. expanded memory.  Therefore, use of EMS in one DOS session does not affect the 
  9205. ability of DOS applications in another DOS session to perform similar EMS 
  9206. functions. 
  9207.  
  9208. The OS/2 2.0 LIM EMS emulation: 
  9209.  
  9210. o Implements all the required functions in the LIM EMS Version 4.0. 
  9211.  
  9212. o Provides each DOS session with a separate EMS emulation.  Each DOS session 
  9213.   has its own set of expanded objects so that features work as they would if 
  9214.   each DOS session was running on a different real 80386.  One DOS session 
  9215.   cannot affect the availability of objects or access memory in other DOS 
  9216.   sessions. 
  9217.  
  9218. o Provides for remapping of conventional memory (below 640KB) for use by 
  9219.   applications. 
  9220.  
  9221. o Provides configurable limits for how much EMS memory is available across DOS 
  9222.   sessions, as well as a limit per DOS session.  The DOS Settings feature 
  9223.   enables the user to override the per-DOS-session limit, subject to the 
  9224.   constraint of the overall limit. 
  9225.  
  9226. o Supports multiple physical-to-single logical mappings.  Different 8086 
  9227.   addresses can map to the same expanded memory object address.  This is 
  9228.   required by some programs. 
  9229.  
  9230. o Can be removed, and the operating system can run without loading EMS in any 
  9231.   DOS session. 
  9232.  
  9233. OS/2 2.0 EMS enables DOS applications to allocate and access up to 32MB of 
  9234. expanded memory in up to 255 EMS objects.  These objects can be mapped into the 
  9235. base memory space (below 1MB) so that the DOS application can access very large 
  9236. address spaces.  Applications access EMS services using the DOS interrupt INT 
  9237. 67H. 
  9238.  
  9239. EMS services are implemented under Enhanced DOS Session using a VDD known as 
  9240. the Virtual Expanded Memory Manager (VEMM). OS/2 2.0 EMS offers a separate EMS 
  9241. emulation to each DOS session by placing most VEMM control structures in a 
  9242. per-DOS-session data area outside the V86-mode address space. Unlike most VDDs, 
  9243. VEMM does not have a corresponding PDD. Instead, VEMM manages its memory using 
  9244. OS/2 2.0 kernel's memory management services.  EMS object allocation, 
  9245. reallocation, or deallocation is accomplished by requesting corresponding 
  9246. services from the operating system's memory manager.  For example, when an 
  9247. application requests the allocation of an expanded memory object, VEMM requests 
  9248. the allocation of a memory object in linear memory outside any DOS session. 
  9249.  
  9250. Typically VEMM is installed at system initialization, by way of a DEVICE= 
  9251. statement in CONFIG.SYS, as shown: 
  9252.  
  9253. DEVICE=C:\OS2\MDOS\VEMM.SYS 4096, 2048
  9254.  
  9255. Loading VEMM 
  9256.  
  9257. To prevent DOS sessions from using all available memory, there is an overall 
  9258. limit on the amount of EMS memory and a default limit for each DOS session to 
  9259. prevent a DOS session from requesting all available EMS memory.  The defaults 
  9260. for these limits are specified in the DEVICE= statement for VEMM.  The default 
  9261. limit for each DOS session can be overridden using the DOS Settings feature. 
  9262.  
  9263. Setting the overall limit to 0 disables EMS in all DOS sessions, regardless of 
  9264. the per-DOS-session value.  Setting the per-DOS-session value to 0 disables EMS 
  9265. in all DOS sessions unless their entries on the Desktop specify a nonzero EMS 
  9266. size. 
  9267.  
  9268. Setting the EMS size to 0 for an entry on the Desktop disables EMS for that DOS 
  9269. session.  Most users need never change the default value.  DOS Settings for 
  9270. frame position, and the size of extra mapping regions above and below 640KB can 
  9271. be configured by the user. 
  9272.  
  9273. Most VEMM setup is postponed until the first INT 67H service request is made. 
  9274. Only remappable conventional memory is set up before that time. This ensures 
  9275. that other VDDs have a chance to reserve read-only memory (ROM) and device 
  9276. memory areas. 
  9277.  
  9278.  
  9279. ΓòÉΓòÉΓòÉ 6.2.6.2. Extended Memory Specification ΓòÉΓòÉΓòÉ
  9280.  
  9281. XMS functions provide another mechanism for DOS applications to access memory 
  9282. above the 1MB limit.  OS/2 2.0 Enhanced DOS Session provides support for LIMA 
  9283. Extended Memory Specification Version 2.0, similar to that provided for LIM EMS 
  9284. Version 4.0, using normal system memory and emulating XMS functions. 
  9285.  
  9286. The extended memory specification manages the following different kinds of 
  9287. memory, as shown in the following figure. 
  9288.  
  9289. o High Memory Area (HMA) 
  9290. o Upper Memory Blocks (UMBs) in the Upper Memory Area (UMA) 
  9291. o Extended Memory Blocks (EMBs) 
  9292.  
  9293. Memory Map of Areas Supported by Extended Memory 
  9294.  
  9295. The OS/2 LIMA XMS emulation: 
  9296.  
  9297. o Implements all LIMA XMS Version 2.0 functions. 
  9298.  
  9299. o Provides each DOS session with a separate XMS emulation.  Each DOS session 
  9300.   has its own high memory area, upper memory blocks, and extended memory 
  9301.   blocks; hence, programs work as they would if each DOS session were running 
  9302.   on a different real 80386.  A DOS session, therefore, cannot affect the 
  9303.   availability of extended memory objects in other DOS sessions or access 
  9304.   memory owned by other DOS sessions. 
  9305.  
  9306. o Provides configurable limits for how much XMS memory is available across all 
  9307.   DOS sessions as well as a limit per DOS session.  The DOS Settings feature 
  9308.   can override the per-DOS-session limit, subject to the constraint of the 
  9309.   overall limit, and can disable XMS altogether for a particular DOS session if 
  9310.   its installation conflicts with the program being run in the DOS session. 
  9311. XMS can be removed, and the operating system can run without loading XMS in any 
  9312. DOS session. 
  9313.  
  9314. Applications that use extended memory can use the XMS support in the same 
  9315. manner as in a native DOS environment.  In addition, portions of the DOS 
  9316. operating system, device drivers, and TSR programs can be loaded into extended 
  9317. memory, thereby conserving memory within the DOS application address space for 
  9318. application use. 
  9319.  
  9320. Older applications that access extended memory directly, rather than through an 
  9321. extended memory manager, might not be compatible with the XMS support under 
  9322. Enhanced DOS Session. 
  9323.  
  9324. XMS services are implemented under Enhanced DOS Session using a VDD known as 
  9325. the Virtual Extended Memory Manager (VXMS). VXMS provides a separate XMS 
  9326. emulation for each DOS session by placing most VXMS control structures in a 
  9327. per-DOS-session data area outside the V86-mode address space. 
  9328.  
  9329. Like VEMM, and unlike most other VDDs, VXMS does not have a corresponding PDD. 
  9330. Instead, VXMS depends on the OS/2 memory manager.  XMS object allocation, 
  9331. reallocation, and deallocation are accomplished by requesting corresponding 
  9332. services from the operating system's memory manager. For example, when an 
  9333. application requests the allocation of a block of extended memory, VXMS 
  9334. requests the memory manager to allocate a memory object in linear memory 
  9335. outside the V86 mode address space.  Reallocation and deallocation are handled 
  9336. similarly. 
  9337.  
  9338. VXMS is loaded at system initialization using a DEVICE= statement in 
  9339. CONFIG.SYS, as shown below: 
  9340.  
  9341. DEVICE=C:\OS2\MDOS\VXMS.SYS/XMMLIMIT=8192,2048
  9342.  
  9343. Loading VXMS 
  9344.  
  9345. This statement should be placed in CONFIG.SYS after the DEVICE= statement for 
  9346. VEMM.SYS, since VXMS queries VEMM to ensure that no conflicts occur in memory 
  9347. allocation. 
  9348.  
  9349. The DEVICE= statement uses parameters to specify the total amount of available 
  9350. XMS memory and the default limit for each DOS session.  In the above example, 
  9351. the overall limit is set to 8MB, and the limit for each DOS session is set to 
  9352. 2MB. 
  9353.  
  9354. The overall limit is the only relationship between XMS memory objects in 
  9355. different DOS sessions; it is imposed to prevent XMS from acquiring all 
  9356. available memory.  The default overall limit is 16MB, and the default limit for 
  9357. each DOS session is 2MB.  The default limit for each DOS session can be 
  9358. overridden by installing an application on the Desktop and choosing to specify 
  9359. the XMS size with the DOS Settings feature. 
  9360.  
  9361. Setting the overall limit to 0 disables XMS in all DOS sessions, regardless of 
  9362. the per-DOS-session value.  Setting the default limit for a particular DOS 
  9363. session to 0 disables XMS in all DOS sessions unless their start list entries 
  9364. specify a nonzero XMS size.  Setting the XMS size to 0 for an entry in the 
  9365. start list disables XMS for that application's DOS session only.  Most users 
  9366. need never change the default values. 
  9367.  
  9368. In addition to memory sizes, the number of handles is a configurable parameter 
  9369. that can be altered on a per-DOS-session basis using the DOS Settings feature. 
  9370.  
  9371. XMS supports use of the HIMEM area-a 64KB area just above 1 MB-that can be used 
  9372. for code or data objects by a DOS application.  Other XMS functions permit 
  9373. moving code and data objects into extended memory and from extended memory to 
  9374. base memory.  Using these functions, an application can provide several 
  9375. overlays, where one overlay at a time is accessible to the application. 
  9376.  
  9377. Under Enhanced DOS Session, EMS and XMS memory allocations are managed as OS/2 
  9378. pageable virtual memory, not as fixed physical memory.  Therefore, the total 
  9379. memory allocated can exceed the amount of system random-access memory (RAM). 
  9380.  
  9381.  
  9382. ΓòÉΓòÉΓòÉ 6.2.6.3. DOS Protect-Mode Interface (DPMI) ΓòÉΓòÉΓòÉ
  9383.  
  9384. Protect-mode specifications are such that communication between protect mode 
  9385. and real mode is difficult.  A DOS TSR, for example, with which an application 
  9386. communicates through a software interrupt or shared buffer, will not work in 
  9387. protect mode.  The real-mode address of the TSR, if used by the protect-mode 
  9388. application, will not point to the same memory space as did the same address in 
  9389. real mode because the segment portion of the address is interpreted differently 
  9390. in each of the two modes. 
  9391.  
  9392. The DPMI is an interface between protect-mode and real-mode programs.  The DPMI 
  9393. consists of a set of protect-mode functions that, among other things, allocate 
  9394. real-mode memory, simulate real-mode interrupts and functions, and intercept 
  9395. real-mode interrupt vectors.  The DPMI breaks the 640KB memory barrier inherent 
  9396. in DOS applications by enabling the applications direct access to 32-bit memory 
  9397. segments.  OS/2 2.0 Enhanced DOS Session supports the DPMI Specification 
  9398. Version 0.9, as defined by the DPMI committee. 
  9399.  
  9400. Using DPMI functions, an application running in protect mode can communicate 
  9401. with the TSR in real mode.  The main function that the DPMI delivers, however, 
  9402. is that it enables DOS extenders to work properly in a multitasking, 
  9403. protect-mode environment. 
  9404.  
  9405. DOS extenders enable DOS applications to access extended memory while running 
  9406. in protect mode.  As required, these extenders switch to: 
  9407.  
  9408. o Protect mode for application code 
  9409. o Real mode for DOS and other real-mode calls. 
  9410.  
  9411. DOS extenders under DOS can switch modes on their own.  However, they cannot do 
  9412. so when the application using the DOS extender is running in a virtual machine. 
  9413. The DPMI provides the same services that DOS extenders use internally to run 
  9414. their applications.  The DOS extender makes INT 31H DPMI calls instead of 
  9415. performing mode switching and selector translation itself. 
  9416.  
  9417. The term real-mode software refers to code that runs in the low 1MB address 
  9418. space and uses segment:offset addressing.  Under many implementations of the 
  9419. DPMI, real-mode software is actually executed in virtual 8086 mode.  Since 
  9420. virtual 8086 mode closely approximates real mode, V86 mode and real mode are 
  9421. interchangeable in the DPMI context. 
  9422.  
  9423. The DPMI facilitates the following: 
  9424.  
  9425. o Enables DOS applications to run in protect mode. 
  9426.  
  9427. o Gives DOS applications access to a large memory address space. 
  9428.  
  9429. o Provides DOS applications with mode switching and calls between V86 (real 
  9430.   mode) and protect mode. 
  9431.  
  9432. o Gives DOS applications access to hardware, such as debug registers, in a way 
  9433.   that is safe for the host operating system. 
  9434.  
  9435. The DPMI is defined to permit DOS programs to access extended memory while 
  9436. maintaining system protection.  The DPMI defines a specific subset of DOS and 
  9437. BIOS calls that can be made by protect-mode DOS programs.  It also defines an 
  9438. interface by way of software interrupt 31H that protect-mode programs can use 
  9439. to allocate memory, modify descriptors, and call real-mode software.  Any 
  9440. operating system that currently supports virtual DOS sessions should be capable 
  9441. of supporting the DPMI without affecting system security. 
  9442.  
  9443. Some DPMI implementations can execute multiple protect-mode programs in 
  9444. independent virtual machines.  In such implementations, DPMI applications can 
  9445. behave exactly like any other standard DOS program. For example, they can run 
  9446. in the background or in a window (if the environment supports these features). 
  9447. Programs that run in protect mode gain all the benefits of virtual memory and 
  9448. can run in 32-bit flat memory model if desired.  OS/2 2.0 provides a DPMI 
  9449. implementation of this nature. 
  9450.  
  9451. DPMI services are available only to protect-mode programs. Programs running 
  9452. real mode cannot use these services.  Protect-mode programs must use a DPMI 
  9453. service to enter protect mode before calling INT 31H services. 
  9454.  
  9455. Some implementations of the DPMI, including OS/2, can run 32-bit 80386-specific 
  9456. programs.  The high word of the 32-bit registers is ignored when running 16-bit 
  9457. protect-mode programs. 
  9458.  
  9459. DPMI services are provided by what is referred to as the DPMI host program. 
  9460. The programs that use DPMI services are called DPMI clients.  Generally, DPMI 
  9461. clients fall into two categories: 
  9462.  
  9463. o Extended applications 
  9464. o Applications that use DPMI directly. 
  9465.  
  9466. Most DPMI applications are likely to be extended applications. These 
  9467. applications are bound with a DOS extender that is the actual DPMI client.  The 
  9468. application calls the DOS extender services, which then are translated by the 
  9469. client (the DOS extender program) into DPMI calls.  The advantage of an 
  9470. extended application over one that calls DPMI services directly is that 
  9471. generally an extender will support more than just the DPMI. 
  9472.  
  9473. A DOS extender can provide a single set of APIs to an application and then 
  9474. translate these APIs to the services (DPMI, EMS, and XMS, for example) that are 
  9475. provided.  Where the host extension services are lacking in a particular 
  9476. function, the extender must provide that function for the application. 
  9477.  
  9478. The application code sits on top of a set of base extender functions and APIs. 
  9479. The extender then has separate modules for each type of extension service and 
  9480. code to fill in where services are lacking.  An example of a typical extender 
  9481. service is protect-mode program loading.  The application code that is actually 
  9482. shipped consists of the application code, together with the DOS extender code 
  9483. and all of its styles of client support.  The host support generally is an 
  9484. extension of the base operating system functions or a device driver used to 
  9485. extend the base operating system functions. 
  9486.  
  9487. Many programs that use DPMI will be bound to DOS extenders so that they can run 
  9488. under any DOS environment.  Existing DOS extenders support APIs that differ 
  9489. from the INT 31H interface. Usually, DOS extenders use an INT 21H multiplex for 
  9490. their extended APIs. 
  9491.  
  9492. Extenders that support the DPMI will need to initialize differently when they 
  9493. are run under DPMI environments.  They will have to enter protect mode using 
  9494. the DPMI real- to protect-mode entry point, install their own API handlers, and 
  9495. then load the DOS extended application program. 
  9496.  
  9497. DOS extenders should check for the presence of the DPMI before attempting to 
  9498. allocate memory or enter protect mode using any other API.  When DPMI services 
  9499. are detected, extenders that provide interfaces that extend or are different 
  9500. from the basic DPMI interface will switch into protect mode and initialize any 
  9501. internal data structures.  DPMI-compatible extenders that provide no API 
  9502. extensions should simply execute the protect-mode application in real mode. 
  9503.  
  9504. The DPMI implementation in OS/2 2.0 has the following characteristics: 
  9505.  
  9506. o The DPMI 0.9 is fully supported. 
  9507. o The DPMI API (INT 31H) support resides outside the kernel and is provided by 
  9508.   a VDD (VDPMI.SYS). 
  9509. o Both kernel support and the DPMI API layer are independently expandable to 
  9510.   future versions of the DPMI. 
  9511.  
  9512. From the application's point of view, it makes no difference whether the actual 
  9513. mode is real or V86. 
  9514.  
  9515. The DPMI is service-request driven.  An application makes an INT 31H service 
  9516. request.  The DPMI VDD handles the request, calling the kernel for basic 
  9517. services, such as allocating memory. The DPMI services are implemented under 
  9518. Enhanced DOS Session using the VDD, VDPMI.SYS.  The DPMI is loaded at system 
  9519. initialization time using a DEVICE= statement in CONFIG.SYS, as shown below: 
  9520.  
  9521. DEVICE=C:\OS2\MDOS\VDPMI.SYS
  9522.  
  9523. Loading the DPMI 
  9524.  
  9525. Windows 3.0**  is not a standard DPMI client and cannot run under the DPMI in a 
  9526. DOS session.  Another VDD, VDPX.SYS, translates system requests (such as INT 
  9527. 21H and BIOS calls) from protect mode to real mode.  This VDD will translate 
  9528. the request from a protect-mode selector:offset to a real-mode address below 1M 
  9529. (segment:offset). Applications can either use this VDD or provide their own 
  9530. translation services. Even with the DPMI, Windows 3.0 cannot run in Windows 
  9531. Enhanced or Standard Mode under OS/2 2.0, because when Windows runs in Enhanced 
  9532. or Standard Mode, it operates at ring 0. Enhanced Mode permits Windows to 
  9533. provide the DPMI, virtual memory, hardware virtualization, and multiple DOS 
  9534. boxes for non-Windows applications.  Under OS/2 2.0, Enhanced DOS Session 
  9535. performs these functions.  When users want to run Windows applications, they 
  9536. start a new DOS session. (However, the application will run in standard mode.) 
  9537.  
  9538.  
  9539. ΓòÉΓòÉΓòÉ 6.3. Inside Enhanced DOS Session ΓòÉΓòÉΓòÉ
  9540.  
  9541. The Intel** 80386 Programmer's Reference (1986) describes the system software 
  9542. that supervises virtual 8086 machines such as the V86 Monitor. To provide 
  9543. support for multiple Enhanced DOS Sessions in OS/2 2.0 in a way that would 
  9544. exploit the existing services of the OS/2 kernel (task scheduling, memory 
  9545. management, interprocess communication, and so on), it was necessary to extend 
  9546. the OS/2 kernel itself.  The Enhanced DOS Session kernel is comprised of three 
  9547. new modules, developed using 32-bit code and the OS/2 2.0 flat memory model. 
  9548. These modules-DOS Emulation, 8086 Emulation, and the DOS Session 
  9549. Manager-provide a full set of control program interfaces known as Virtual 
  9550. DevHlp services, which are invoked by VDD modules.  VDDs provide 
  9551. device-specific support, such as hardware virtualization, BIOS emulation, and 
  9552. other low-level system functions. 
  9553.  
  9554. The VDD model is of interest to developers whose DOS applications provide 
  9555. hardware-specific functions on non-IBM option adapters.  The following section 
  9556. describes the VDD architecture and gives an overview of Enhanced DOS Session 
  9557. operations with emphasis on the behavior of VDDs. 
  9558.  
  9559.  
  9560. ΓòÉΓòÉΓòÉ 6.3.1. Virtual Device Helper Services ΓòÉΓòÉΓòÉ
  9561.  
  9562. Several categories of virtual DevHlp services are available to all VDDs.  These 
  9563. services control access to system resources, such as memory, timers, and 
  9564. semaphores.  DOS session events, such as DOS Session foreground and background 
  9565. state switching, can be tracked using virtual DevHlp services.  A VDD can 
  9566. display error messages by way of the VDHPopUp service.  Other virtual DevHlp 
  9567. services enable a VDD to establish communications with another VDD or with a 
  9568. PDD.  Typically, the VDD also must hook a set of system traps that are 
  9569. generated when certain 8086 instructions are executed in V86 mode.  To get 
  9570. control, a VDD usually hooks the following traps using the appropriate virtual 
  9571. DevHlp services: 
  9572.  
  9573. o Traps generated when a DOS application performs direct I/O to a port that is 
  9574.   being virtualized (IN and OUT instructions) 
  9575.  
  9576. o Traps generated when a BIOS or other software interrupt function is executed 
  9577.   in a DOS session (INT instructions) 
  9578.  
  9579. o Traps generated when a DOS application attempts to access memory that is 
  9580.   mapped to a physical device over which the VDD has control 
  9581.  
  9582. Another important category of virtual DevHlp services are those that support 
  9583. the simulation of hardware interrupts.  These services control the state of the 
  9584. virtual programmable interrupt controller. 
  9585.  
  9586. All the virtual DevHlp services that use 32-bit code are callable from 
  9587. assembler language. 
  9588.  
  9589. For more information on VDH services, see the OS/2 2.0 Virtual Device Driver 
  9590. Reference. 
  9591.  
  9592.  
  9593. ΓòÉΓòÉΓòÉ 6.3.2. The Virtual Device Driver Model ΓòÉΓòÉΓòÉ
  9594.  
  9595. All OS/2 1.X device drivers are bi-modal; they are required to run in either 
  9596. real mode or protect mode.  This is true even if the device driver does not 
  9597. provide explicit DOS-mode support (such as hooking a DOS-mode software 
  9598. interrupt).  Because Enhanced DOS Session eliminates real-mode execution, 
  9599. existing device drivers should be updated to remove the real-mode sections. 
  9600. These drivers are now referred to as physical device drivers. 
  9601.  
  9602. VDDs are new in OS/2 2.0.  They are written as 32-bit, flat-memory model, 
  9603. protect-mode modules. The following figure shows the structure of VDDs and the 
  9604. interfaces to a PDD. 
  9605.  
  9606. Structure of Virtual and Physical Device Drivers 
  9607.  
  9608. All VDDs are loaded and initialized during the system initialization (boot) 
  9609. process.  Many of them establish communication at that time with the associated 
  9610. PDD. The following table lists the VDDs provided in OS/2 2.0 and indicates 
  9611. those that have a direct interface with an OS/2 PDD.  The VDD controls access 
  9612. to the device by any DOS application, and relies on the PDD to manage the 
  9613. physical hardware operations. 
  9614.  
  9615. OS/2 2.0 Virtual Device Drivers
  9616.  
  9617. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9618. ΓöéVDD                           ΓöéInterfaces with PDD           Γöé
  9619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9620. ΓöéBIOS                          Γöé                              Γöé
  9621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9622. ΓöéCMOS/Real-Time Clock          Γöé                              Γöé
  9623. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9624. ΓöéProgrammable Interrupt        Γöé                              Γöé
  9625. ΓöéController                    Γöé                              Γöé
  9626. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9627. ΓöéTimer                         Γöé     X                        Γöé
  9628. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9629. ΓöéKeyboard                      Γöé     X                        Γöé
  9630. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9631. ΓöéMouse                         Γöé     X                        Γöé
  9632. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9633. ΓöéDisk/Diskette                 Γöé     X                        Γöé
  9634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9635. ΓöéDMA Controller                Γöé                              Γöé
  9636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9637. ΓöéVideo (EGA, VGA, and 8514/A)  Γöé                              Γöé
  9638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9639. ΓöéPrinter                       Γöé     X                        Γöé
  9640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9641. ΓöéCOM                           Γöé     X                        Γöé
  9642. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9643. ΓöéExpanded Memory Specification Γöé                              Γöé
  9644. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9645. ΓöéExtended Memory Specification Γöé                              Γöé
  9646. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9647. ΓöéNumeric Coprocessor (80387)   Γöé                              Γöé
  9648. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9649. ΓöéVCDROM                        Γöé                              Γöé
  9650. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9651. ΓöéVDPMI                         Γöé                              Γöé
  9652. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9653. ΓöéVDPX                          Γöé                              Γöé
  9654. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9655. Γöé                              Γöé                              Γöé
  9656. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9657.  
  9658. For example, the virtual COM device driver has a direct interface to the 
  9659. physical COM device driver.  This interface enables the COM PDD to service all 
  9660. the hardware interrupts and to buffer data being transmitted or received.  The 
  9661. virtual COM driver emulates asynchronous communications BIOS functions (INT 
  9662. 14H) to send and receive characters and to set or query the state of a COM 
  9663. port.  The virtual COM driver also virtualizes the I/O ports associated with a 
  9664. COM port; virtualization implies separate simulation of the physical hardware 
  9665. (in this case, I/O ports) for each DOS session.  This permits the physical COM 
  9666. driver to manage the actual COM port hardware, while a DOS application accesses 
  9667. only a virtual copy of the port.  With this design, an OS/2 application can 
  9668. operate on one COM port while a DOS application accesses a second COM port. 
  9669. Both of these applications can perform data communications in the background. 
  9670. The relationship between a VDD and PDD is shown in the following figure. 
  9671.  
  9672. Physical and Virtual Device Drivers Under OS/2 2.0 
  9673.  
  9674. Not every VDD needs to operate with a PDD the way indicated for COM port 
  9675. virtualization, as shown from the list in the following table. The VDD-PDD 
  9676. interface is required when the device generates hardware interrupts that must 
  9677. be simulated in the context of the DOS session.  For example, many DOS 
  9678. applications that support asynchronous communications include hardware 
  9679. interrupt handler routines. These routines typically perform I/O directly to 
  9680. the COM port hardware rather than going through BIOS. 
  9681.  
  9682. To support these DOS applications and to permit them to run in the background 
  9683. and foreground, the virtual COM device driver simulates hardware interrupts in 
  9684. the task-time context of the V86 mode process. DOS sessions are scheduled to 
  9685. run using the same preemptive time-slicing, task-dispatching method that drives 
  9686. the multitasking OS/2 sessions. Hardware interrupts, on the other hand, occur 
  9687. asynchronously to this task-scheduling process.  By simulating the hardware 
  9688. interrupts and presenting a virtual hardware state, the interrupt handling 
  9689. logic of the DOS application does not execute on the physical interrupt thread. 
  9690. This means that switching to V86 mode is not done at interrupt time but 
  9691. deferred until the scheduler dispatches the DOS session task. 
  9692.  
  9693. The advantage of simulated interrupts is that mode switching and hardware 
  9694. virtualization do not need to be done at interrupt time.  Also, the DOS 
  9695. application does not get control at interrupt time, which helps to maintain 
  9696. system integrity. 
  9697.  
  9698. A potential disadvantage of this approach is that DOS applications with 
  9699. routines that are highly real-time dependent might not operate correctly under 
  9700. heavy system load conditions.  When developing a VDD, it is important to 
  9701. consider the time-dependent aspects of the DOS application and to design the 
  9702. hardware virtualization to satisfy this dependency. This usually can be 
  9703. achieved when all hardware states can be simulated in software and where 
  9704. performance considerations remain high on the VDD-PDD designer's agenda. 
  9705.  
  9706.  
  9707. ΓòÉΓòÉΓòÉ 6.3.3. Communication with OS/2 Processes ΓòÉΓòÉΓòÉ
  9708.  
  9709. Another feature of OS/2 2.0 permits protect-mode OS/2 processes to request 
  9710. services directly from a VDD.  New OS/2 functions, as shown in the following 
  9711. table, support this capability. 
  9712.  
  9713. VDD Services 
  9714.  
  9715. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9716. ΓöéFunction            ΓöéDescription                             Γöé
  9717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9718. ΓöéDosOpenVDD          ΓöéOpens a virtual device driver (gets a   Γöé
  9719. Γöé                    Γöéhandle to a VDD).                       Γöé
  9720. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9721. ΓöéDosRequestVDD       ΓöéPermits a protect-mode OS/2 application Γöé
  9722. Γöé                    Γöéto communicate with a VDD.              Γöé
  9723. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9724. ΓöéDosCloseVDD         ΓöéCloses a virtual device driver (frees a Γöé
  9725. Γöé                    Γöéhandle to a VDD).                       Γöé
  9726. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9727.  
  9728. The VDD designer can provide any appropriate services across this interface, 
  9729. depending on the hardware being virtualized.  Potential uses of this interface 
  9730. include the ability of OS/2 applications to communicate with DOS applications. 
  9731. To achieve this, the VDD also would have to provide DOS applications with an 
  9732. interface to establish the communications.  This could be done, for example, by 
  9733. defining a series of software interrupt functions that a DOS application could 
  9734. invoke. 
  9735.  
  9736.  
  9737. ΓòÉΓòÉΓòÉ 6.4. Summary ΓòÉΓòÉΓòÉ
  9738.  
  9739. OS/2 2.0 provides a redesigned DOS-compatibility environment known as Enhanced 
  9740. DOS Session.  Features of Enhanced DOS Session include: 
  9741.  
  9742. o The ability to run DOS applications as V86 mode-tasks.  This eliminates the 
  9743.   operating system overhead of switching between real mode and protect mode and 
  9744.   provides a fully protected system environment. 
  9745.  
  9746. o The ability to start many concurrent DOS sessions, each operating in its own 
  9747.   independent 1MB linear address space. 
  9748.  
  9749. o The ability to customize the operation of DOS sessions through DOS Settings. 
  9750.  
  9751. o The ability to run DOS programs in windows in the PM environment. 
  9752.  
  9753. o Increased available base memory over previous versions of the operating 
  9754.   system. 
  9755.  
  9756. o Support for Expanded Memory Specification (EMS) and Extended Memory 
  9757.   Specification (XMS).  This permits DOS applications to access memory above 
  9758.   the 1MB real-mode addressing limit, to have total code and data space larger 
  9759.   than the available base memory, and to have very large code or data objects 
  9760.   loaded into memory for enhanced execution speed. 
  9761.  
  9762. The Enhanced DOS Session is composed of three modules-DOS Emulation, 8086 
  9763. Emulation, DOS Session Manager-which provide a full set of control program 
  9764. interfaces known as virtual device helper services. These services are invoked 
  9765. by VDD modules. VDD modules provide hardware-specific support, such as hardware 
  9766. virtualization, BIOS emulation, and other low-level system functions. 
  9767.  
  9768.  
  9769. ΓòÉΓòÉΓòÉ 7. Object-Oriented Programming Using SOM ΓòÉΓòÉΓòÉ
  9770.  
  9771. This chapter describes the IBM System Object Model (SOM) for object-oriented 
  9772. programming. It assumes a knowledge of object-oriented programming and design 
  9773. concepts. 
  9774.  
  9775.  
  9776. ΓòÉΓòÉΓòÉ 7.1. Object-Oriented Programming ΓòÉΓòÉΓòÉ
  9777.  
  9778. Object-oriented programming is a programming paradigm based on objects, which 
  9779. are programming constructs designed to reflect items in the real world. An 
  9780. object consists of both the data necessary to describe a real-world item and 
  9781. the functions necessary to describe the behavior of the item. This is in 
  9782. contrast to the structured programming model, which focuses on the things that 
  9783. can be done to the data (the functions) and which treats the data only as 
  9784. something to be acted on. Objects bind together the data that describes an item 
  9785. and the functions that act on the data. 
  9786.  
  9787. The basic unit of organization in object-oriented programming is the object, 
  9788. which is a data structure that consists of data and functions. The data is 
  9789. called the object's state. The functions that define the object's behavior are 
  9790. called methods. Objects are instances, or instantiations, of a class. A class 
  9791. is a description of an object. It defines the data that represents the object's 
  9792. state and the methods that the object supports. 
  9793.  
  9794.  
  9795. ΓòÉΓòÉΓòÉ 7.1.1. Object-Oriented Programming Example ΓòÉΓòÉΓòÉ
  9796.  
  9797. An example might make object-oriented programming concepts clearer. A stack is 
  9798. a common programming construct, permitting data to be stored and retrieved in a 
  9799. Last-In, First-Out (LIFO) manner-that is, the last data element placed on the 
  9800. stack is the first element that is retrieved from the stack. 
  9801.  
  9802. The data structure for the stack describes the stack-a place to store the data 
  9803. put on the stack and a variable to keep track of the location of the top of the 
  9804. stack. Given the definition of the data structure, multiple instances of the 
  9805. stack can be declared within a program. 
  9806.  
  9807. There are two basic operations that can be performed on a stack:  pushing data 
  9808. onto the stack and popping data off of the stack. It also would be beneficial 
  9809. to be able to dynamically create a stack. Functions to perform these activities 
  9810. must be defined. 
  9811.  
  9812. The following figure shows the definition of a stack data structure and 
  9813. functions and the implementation for one of the functions. For clarity, the C 
  9814. programming language is used in this example. 
  9815.  
  9816. /* Define the stack */
  9817.  
  9818. struct stackType {
  9819.   void *stackArray[STACK_SIZE];
  9820.   int stackTop;
  9821. };
  9822. typedef struct stackType Stack;
  9823.  
  9824. /* Define the stack's functions */
  9825.  
  9826. Stack *Create();                /* Create a new stack.        */
  9827. void Push(Stack *thisStack,     /* Push an element onto stack.*/
  9828.           void *nextElement);
  9829. void *Pop(Stack *thisStack);    /* Pop an element off stack.  */
  9830.  
  9831. /* The definition of the Push function is provided as an example.  */
  9832. /* The rest of the functions would be defined in a similar manner. */
  9833.  
  9834. void Push(Stack *thisStack, void *nextElement)
  9835. {
  9836.   thisStack->stackArray[thisStack->stackTop] = nextElement;
  9837.   thisStack->stackTop++;
  9838. }
  9839.  
  9840. Generic Stack Functions in C 
  9841.  
  9842. A client program might use this stack to create a stack of words needing 
  9843. interpretation, as in the following figure. 
  9844.  
  9845. main()
  9846. {
  9847.   Stack *WordStack;
  9848.  
  9849.   char *Subject = "Emily";
  9850.   char *Verb = "eats";
  9851.   char *Object = "ice cream";
  9852.   char *NextWord;
  9853.  
  9854.   WordStack = Create();
  9855.   Push(WordStack, Object);
  9856.   Push(WordStack, Verb);
  9857.   Push(WordStack, Subject);
  9858.  
  9859.   /* ... */
  9860.  
  9861.   while (NextWord = Pop(WordStack)) {
  9862.     printf("%s\n", NextWord);
  9863.  
  9864.     /* ... */
  9865.  
  9866.   }
  9867. }
  9868.  
  9869. Using Generic Stack Functions in C 
  9870.  
  9871. The stack is an example of a class. The stack contains two data elements 
  9872. (stackArray and stackTop), and supports three methods: Create, Push, and Pop. 
  9873. WordStack is an object of class Stack; it also can be called an instance of a 
  9874. stack. 
  9875.  
  9876. Methods must know the specific object on which they are to operate, which is 
  9877. called the target object or, sometimes, the receiving object. Notice that each 
  9878. method (except Create) takes as its first parameter a pointer to the target 
  9879. object. This is because a program might have many objects of a given class, and 
  9880. each is a potential target for the class methods. 
  9881.  
  9882.  
  9883. ΓòÉΓòÉΓòÉ 7.2. IBM System Object Model ΓòÉΓòÉΓòÉ
  9884.  
  9885. OS/2 2.0 includes a language-neutral, object-oriented programming mechanism 
  9886. called the System Object Model (SOM).  SOM is designed specifically to support 
  9887. the new, object-oriented paradigm, and to be usable with both procedural 
  9888. (non-object-oriented) languages and object-oriented languages.  (This release 
  9889. of SOM supports only the C language.) SOM is not a language-it is a system for 
  9890. defining, manipulating, and releasing class libraries.  SOM is used to define 
  9891. classes and methods, while permitting the developer to choose a language for 
  9892. implementing these methods.  Most programmers, therefore, will be able to use 
  9893. SOM quickly without having to learn a new language syntax. SOM consists of a 
  9894. run-time library and a set of utility programs that support building, 
  9895. externalizing, and manipulating software objects. 
  9896.  
  9897. SOM objects are language-neutral.  They can be defined in one programming 
  9898. language and used by applications or objects written in another programming 
  9899. language. 
  9900.  
  9901.  
  9902. ΓòÉΓòÉΓòÉ 7.2.1. SOM Features ΓòÉΓòÉΓòÉ
  9903.  
  9904. SOM offers three important object-oriented programming features: encapsulation, 
  9905. inheritance, and polymorphism. 
  9906.  
  9907.  
  9908. ΓòÉΓòÉΓòÉ 7.2.1.1. Encapsulation ΓòÉΓòÉΓòÉ
  9909.  
  9910. An object consists of data and actions (methods) that can be performed on that 
  9911. data.  An object has an external (public) view that prescribes how other 
  9912. objects or applications can interact with it.  An object also has an internal 
  9913. (private) view that prescribes how data and methods actually are implemented. 
  9914. Object implementation is hidden (encapsulated) from the public view. 
  9915.  
  9916. Developers of SOM objects can externalize as much of an object's definition as 
  9917. they choose.  The developers, however, should carefully consider what they 
  9918. choose to externalize.  Published methods and instance variables become a 
  9919. permanent part of an object's interface.  Unnecessary externalization of an 
  9920. object's definition might compromise future compatibility. 
  9921.  
  9922. SOM permits changes to an object's internal implementation without affecting 
  9923. the compatibility of resulting binaries. This means that applications using SOM 
  9924. objects will not require recompilation when the SOM object definitions change. 
  9925. Full forward, binary compatibility can be retained when: 
  9926.  
  9927. o Adding new methods 
  9928.  
  9929. o Adding, changing, or deleting unpublished instance variables, provided that 
  9930.   old methods still can be supported 
  9931.  
  9932. o Inserting new classes above your class in the inheritance hierarchy 
  9933.  
  9934. o Relocating methods upward in the class hierarchy. 
  9935.  
  9936.  
  9937. ΓòÉΓòÉΓòÉ 7.2.1.2. Inheritance ΓòÉΓòÉΓòÉ
  9938.  
  9939. Inheritance is the derivation of new child classes from existing parent 
  9940. classes. Child classes inherit the characteristics of their parent classes. 
  9941. This means that methods defined for a parent class automatically are defined 
  9942. for the child class. Child classes also can add unique characteristics to their 
  9943. parent classes, in addition to those they have inherited.  This means that 
  9944. child classes can define new behavior in terms of new methods.  These child 
  9945. classes also are known as subclasses. 
  9946.  
  9947.  
  9948. ΓòÉΓòÉΓòÉ 7.2.1.3. Polymorphism ΓòÉΓòÉΓòÉ
  9949.  
  9950. Polymorphism, basically, is many implementations of the same method for two or 
  9951. more classes of objects.  This is known in SOM as method overrides, or override 
  9952. resolution. SOM supports various types of polymorphism, so it readily can be 
  9953. mapped into different object-oriented languages.  The following example 
  9954. describes one type of polymorphism: polymorphism by inheritance. 
  9955.  
  9956. As child classes are derived from parent classes, inherited methods can be 
  9957. overridden. For example, suppose that ClassB is a child of ClassA, as 
  9958. illustrated in the following figure. 
  9959.  
  9960.  
  9961.  Definition of ClassA                      Definition of ClassB
  9962. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9963. Γöé     .                         Γöé        Γöé     .                          Γöé
  9964. Γöé  MethodA:                     Γöé        Γöé   MethodA:                     Γöé
  9965. Γöé     Print something.          ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé    Print something else.       Γöé
  9966. Γöé     .                         Γöé        Γöé     .                          Γöé
  9967. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9968.  
  9969.  
  9970. Polymorphism by Inheritance 
  9971.  
  9972. MethodA is one of the methods defined for ClassA.  It also is one of the 
  9973. methods defined for ClassB and is inherited from ClassA.  In SOM, MethodA can 
  9974. be overridden in the definition of ClassB to do different things for ClassB. 
  9975. MethodA, therefore, is defined for both ClassA and ClassB but is implemented 
  9976. differently for ClassA and ClassB. This means that method resolution requires 
  9977. the name of the method as well as the object being acted upon. 
  9978.  
  9979.  
  9980. ΓòÉΓòÉΓòÉ 7.2.2. The SOM Run-Time Environment ΓòÉΓòÉΓòÉ
  9981.  
  9982. The SOM run-time environment contains the basic data structures and functions 
  9983. that are used to define, create, and manage classes and objects in terms of 
  9984. other classes. 
  9985.  
  9986. Classes are generic definitions of sets of objects and their behavior. Classes 
  9987. are defined at compilation time.  Class objects are the SOM run-time 
  9988. implementation of SOM classes.  Because the terms classand class object refer 
  9989. to the same thing, but in different contexts (compilation time and runtime), 
  9990. they can be used interchangeably. 
  9991.  
  9992. Objects are created dynamically during run time.  Objects are instances of 
  9993. classes.  The methods that an object responds to are referred to as instance 
  9994. methods, because any object instance can perform them. An object's instance 
  9995. methods are defined in its class definition, and cannot be used unless an 
  9996. object instance already exists.  Object instances are created by methods that 
  9997. operate on the class object to make it produce an object instance.  Class 
  9998. methods that create object instances are called factory methods, or 
  9999. constructors. SOM classes that define factory methods for classes are called 
  10000. metaclasses. Metaclasses are classes of classes.  A class object is an instance 
  10001. of its metaclass. 
  10002.  
  10003. The relationship between objects, classes, and metaclasses is shown in the 
  10004. following figure. 
  10005.  
  10006.                                 Only one of These     Only one of These
  10007.                                  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10008.                                  Γöé    The    Γöé         Γöé  The object'sΓöé
  10009.                          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé  object's ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé  metaclass,  Γöé
  10010.      Many of These       Γöé       Γöé class, "C Γöé         Γöé      "M"     Γöé
  10011.     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10012.    ΓöîΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé     Γöé
  10013.  ΓöîΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé Γöé     Γöé       Defined here are       Defined here are
  10014. ΓöîΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé Γöé Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ       instance methods       class methods
  10015. Γöé     An     Γöé Γöé ΓöéΓöÇΓöÿ             for class "C" that     for class "M" that
  10016. Γöé   object,  Γöé ΓöéΓöÇΓöÿ               operate on objects     operate on class
  10017. Γöé    "O"     ΓöéΓöÇΓöÿ                 "O" (instances of      (object) "C" to
  10018. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                   class "C").            cause it to produce
  10019.                                                         instances of "C."
  10020.  
  10021.  
  10022. Classes and Metaclasses 
  10023.  
  10024. The SOM environment can be created automatically or explicitly within any 
  10025. process that uses it.  SOM supplies three classes, as shown in the following 
  10026. table. Classes that make up the SOM run-time environment are packaged with the 
  10027. operating system in SOM.DLL. 
  10028.  
  10029. SOM-Supplied Classes 
  10030.  
  10031. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10032. ΓöéObject                        ΓöéDescription                   Γöé
  10033. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10034. ΓöéSOMObject                     ΓöéRoot class for all SOM        Γöé
  10035. Γöé                              Γöéclasses.                      Γöé
  10036. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10037. ΓöéSOMClass                      ΓöéRoot class for all SOM        Γöé
  10038. Γöé                              Γöémetaclasses.                  Γöé
  10039. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10040. ΓöéSOMClassMgr                   ΓöéClass for SOMClassMgrObject.  Γöé
  10041. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10042.  
  10043. SOMObject defines the essential behavior common to all SOM objects.  All SOM 
  10044. classes are subclasses of SOMObject. SOMClass defines the essential behavior 
  10045. common to all SOM class objects.  SOMClass is a subclass of SOMObject and is 
  10046. the metaclass of the SOMObject class.  By definition, SOMClass is its own 
  10047. metaclass.  SOMClassMgr is the class definition for the SOMClassMgrObject that 
  10048. is created during SOM initialization. 
  10049.  
  10050. During SOM initialization, four objects are created, as shown in the following 
  10051. figure. Three of these objects are class objects. 
  10052.  
  10053.                           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10054.                           Γöé SOMObject    ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé    SOMClass   Γöé
  10055.                           Γöé class object Γöé   ΓöîΓöÇΓöÇΓöÇΓöé  class object Γöé
  10056.                           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ   Γöé    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10057. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ   Γöé
  10058. ΓöéSOMClassMgrObjectΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé SOMClassMgr  Γöé   Γöé
  10059. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ       Γöé class object ΓöéΓöÇΓöÇΓöÇΓöÿ
  10060.                           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10061.  
  10062. SOM Objects at Initialization 
  10063.  
  10064. The SOMClass class object provides constructors for SOMObject class objects and 
  10065. for the SOMClassMgr class object.  SOMObject defines a set of methods common to 
  10066. all SOM objects.  Because all classes are subclasses of SOMObject, they inherit 
  10067. the set of methods common to all SOM objects.  SOMClassMgrObject is an instance 
  10068. of the SOMClassMgr class object.  SOMClassMgrObject dynamically loads and 
  10069. unloads class libraries when referenced and tracks instances of class objects. 
  10070.  
  10071.  
  10072. ΓòÉΓòÉΓòÉ 7.2.3. Creating SOM Classes ΓòÉΓòÉΓòÉ
  10073.  
  10074. The first step in creating a SOM class is to define the class and its 
  10075. relationship to other classes.  In SOM, a class is defined in a class 
  10076. definition file. Class definition files are ASCII files with an extension of 
  10077. .CSC. The class definition is described in a formal specification language, the 
  10078. SOM Object Interface Definition Language (OIDL). OIDL has a language-neutral 
  10079. core (appropriate for any programming language), to which some minor extensions 
  10080. have been added to simplify programming in C. For OS/2 2.0, OIDL supports the 
  10081. C-programming language only. 
  10082.  
  10083. The second step is to process the OIDL class definition file using the SOM 
  10084. compiler to produce a set of language-specific or use-specific binding files 
  10085. for the class. The binding files then are used to build class libraries that 
  10086. can be used by client applications; that is, applications that are to create 
  10087. subclasses or object instances. 
  10088.  
  10089. Note:  Hereafter, any information concerning SOM bindings is specifically 
  10090.        geared toward the SOM C-language bindings, as distinguished from other 
  10091.        SOM language bindings. 
  10092.  
  10093.  
  10094. ΓòÉΓòÉΓòÉ 7.2.4. Object Interface Definition Language ΓòÉΓòÉΓòÉ
  10095.  
  10096. The class definition file provides a complete description of a class, including 
  10097. its relationship to other classes, its instance data, and the methods that it 
  10098. supports and overrides.  An Object Interface Definition Language (OIDL) class 
  10099. definition file for C language also describes information specific to building 
  10100. C-language binding files. An OIDL class definition file for C language is 
  10101. divided into eight sections, as shown in the Class Definition File template in 
  10102. the following figure. The sections are placed in the template in the 
  10103. recommended order. 
  10104.  
  10105.   ---Include Section (Required)
  10106.   ---   Directions that tell the SOM compiler where to find the class
  10107.   ---   definitions for the parent class, metaclass, and any ancestor
  10108.   ---   class for which this class overrides one or more of its methods.
  10109.   ---
  10110.   ---Class Section (Required)
  10111.   ---   Name, attributes, and description of the class, and
  10112.   ---   directions that tell the SOM compiler how to name and
  10113.   ---   build the binding files it generates.
  10114.   ---
  10115.   ---Release Order Section (Optional)
  10116.   ---   All method names and public instance variables introduced
  10117.   ---   by the class.
  10118.   ---
  10119.   ---Metaclass Section (Optional)
  10120.   ---   Name and description of metaclass, if not a metaclass of the
  10121.   ---   parent class.
  10122.   ---
  10123.   ---Parent Class Section (Required)
  10124.   ---   Name and description of the parent class.
  10125.   ---
  10126.   ---Passthru Section (Optional)
  10127.   ---   Blocks of code or comments that are not processed by the SOM
  10128.   ---   compiler, but are placed "as is" in the specified binding file.
  10129.   ---
  10130.   ---Data Section (Optional)
  10131.   ---   Instance variables for the objects belonging to this class
  10132.   ---
  10133.   ---Methods Section (Optional)
  10134.   ---   New methods and method overrides supported by the class.
  10135.  
  10136. Class Definition File Template 
  10137.  
  10138. Three of the eight sections are required for a class definition file:  the 
  10139. Include, Class, and Parent Class sections.  The Include section must describe 
  10140. where the definitions for the class's parent, ancestors, and metaclasses can be 
  10141. found.  The minimum information that the Class and Parent Class sections must 
  10142. provide are the names of the class and its parent class. 
  10143.  
  10144. The Metaclass section is used to specify the name of a class's metaclass.  This 
  10145. is necessary only when the class's metaclass is not the same as its parent's 
  10146. metaclass.  If this is the case, the location for the metaclass definition must 
  10147. be added to the Include section.  If a metaclass name is not specified in this 
  10148. section, then it is assumed (by default) that the class's metaclass is the same 
  10149. as its parent's metaclass. 
  10150.  
  10151. When a class has the same metaclass as its parent, new methods can be added to 
  10152. the set of class methods, or class methods can be overridden by specifying the 
  10153. CLASS attribute in the Data and Methods sections of the class definition file. 
  10154. When this occurs, SOM creates a subclass of the parent class's metaclass, which 
  10155. then becomes the class's metaclass.  The class's metaclass then is referred to 
  10156. as an implied metaclass.  Creating a subclass of the parent's class can be done 
  10157. explicitly by creating another class definition.  But implied metaclasses 
  10158. eliminate the overhead of these additional class definitions. 
  10159.  
  10160. The Data section of a class definition file describes data elements contained 
  10161. by objects of the class, that is, instance data. The Data section contains 
  10162. C-language data declarations for instance data.  Instance data can be declared 
  10163. private or public.  By default, instance data is private; that is, it can be 
  10164. accessed only by methods of the class.  It cannot be accessed by client 
  10165. applications.  Public instance data is part of the published external interface 
  10166. and can be accessed by client applications. 
  10167.  
  10168. The Methods section of a class definition file describes methods to which 
  10169. objects of this class can respond, including overrides to methods of ancestor 
  10170. classes.  The Methods section contains the C-language function prototypes that 
  10171. define the calling sequence for each method new to the class.  The Methods 
  10172. sections also contains the names of inherited methods that will be overridden, 
  10173. or implemented differently, by the class. Methods can be private or public.  In 
  10174. contrast to instance data, methods are public by default. 
  10175.  
  10176. The order in which public instance data is declared or methods are described in 
  10177. the class definition file is critical for future compatibility when new public 
  10178. data or methods might be introduced in the class definition.  Public instance 
  10179. data can be declared, in any order, in the Data section of the class definition 
  10180. file.  Methods are described in the Methods section of the class definition 
  10181. file and can be in any order or grouped by function category. By default, when 
  10182. the SOM compiler processes the class definition file, it builds the internal 
  10183. data structures for the binding files, based on the order in which the public 
  10184. instance data and methods are described in the class definition file.  If, at a 
  10185. later date, new data or methods change the original ordering of public data and 
  10186. methods for the class, the binding files and class library are built 
  10187. differently.  Client applications then must be recompiled. 
  10188.  
  10189. The Release Order section of a class definition file is the SOM solution to 
  10190. maintaining compatibility between changing class definitions and client 
  10191. applications. This section contains a list of all method names and public 
  10192. instance variables introduced by the class.  The ordering of this list does not 
  10193. necessarily match the ordering of the instance-data declarations in the Data 
  10194. section or the ordering of the method descriptions in the Methods section.  The 
  10195. Release Order list overrides the default processing of the SOM compiler.  It 
  10196. directs the SOM compiler to process the data declarations and method definition 
  10197. in the order specified, not as they occur in the class definition file.  This 
  10198. means that if a new method is inserted in a method group in the middle of the 
  10199. Methods, section and the method name is added to the end of the Release Order 
  10200. list in the Release Order section, compatibility with client applications can 
  10201. be preserved. 
  10202.  
  10203. Note:  If you want the SOM compiler to produce a release order section for you 
  10204.        automatically, you must request a CS2 file. The CS2 file will have the 
  10205.        same content as the original class definition file, except that its 
  10206.        release order statement will always be complete (even if the release 
  10207.        order statement in the class definition file is not), and a consistent 
  10208.        comment style will appear throughout. 
  10209.  
  10210. The following figure shows the structure of a sample class definition file that 
  10211. groups methods that operate on instance data.  In this example, the release 
  10212. order list groups related methods and data accordingly, that is, by instance 
  10213. variable and the functions that operate on that instance variable. 
  10214.  
  10215.    #include "somobj.sc"
  10216.  
  10217.    class: example;
  10218.  
  10219.    release order:  var1, get_var1, set_var1, var2, get_var2, set_var2;
  10220.  
  10221.    parent:  SOMObject;
  10222.  
  10223.    data:  var1, public;
  10224.           var2, public;
  10225.  
  10226.    methods:
  10227.        group:  get_methods
  10228.          get_var1
  10229.  
  10230.          get_var2
  10231.  
  10232.        group:  set_methods
  10233.          set_var1
  10234.  
  10235.          set_var2
  10236.  
  10237. Structure of a Sample Class Definition File 
  10238.  
  10239. If methods that operate on a third instance variable are added to the class 
  10240. definition file, compatibility with clients of the Example class defined in the 
  10241. above figure can be maintained by modifying the release order, as shown in the 
  10242. following figure. 
  10243.  
  10244.    #include "somobj.sc"
  10245.  
  10246.    class: example;
  10247.  
  10248.    release order:  var1, get_var1, set_var1,
  10249.                    var2, get_var2, set_var2,
  10250.                    var3, get_var3, set_var3;
  10251.  
  10252.    parent:  SOMObject;
  10253.  
  10254.    data:  var1, public;
  10255.           var2, public;
  10256.           var3, public;
  10257.  
  10258.    methods:
  10259.        group:  get_methods
  10260.          get_var1
  10261.  
  10262.          get_var2
  10263.  
  10264.          get_var3
  10265.  
  10266.        group:  set_methods
  10267.          set_var1
  10268.  
  10269.          set_var2
  10270.  
  10271.          set_var3
  10272.  
  10273. Maintaining Compatibility by Modifying the Release Order 
  10274.  
  10275. In the above figure, the get_var3 and set_var3 methods are inserted in the 
  10276. get_methods and set_methods groups, respectively. The var3 instance variable is 
  10277. added to the end of the list of instance data.  The new instance data and 
  10278. method names are added to the end of the release order list. 
  10279.  
  10280. Without a release order list, the data and methods in the first version of the 
  10281. Example class are processed in the order in which they occur in the file: 
  10282.  
  10283. var1, var2, get_var1, get_var2, set_var1, set_var2
  10284.  
  10285. Without a release order list, the data and methods in the second version of the 
  10286. Example class are processed in the order in which they occur in the file: 
  10287.  
  10288. var1, var2, var3, get_var1, get_var2, get_var3, set_var1, set_var2, set_var3
  10289.  
  10290. Without a release order list, the data and method information maintained by SOM 
  10291. in the object data structures built for the first version of the Example class 
  10292. does not match that built for the second version of the Example class.  The 
  10293. second version is not compatible with clients of the first version. 
  10294.  
  10295. A class definition file is made more readable by the use of comments. Several 
  10296. comment styles are supported by OIDL, as shown in the following figure. 
  10297.  
  10298.   /*
  10299.    * This is a comment that will appear
  10300.    * in the language binding files.
  10301.   */
  10302.  
  10303.   -- This is a comment that will appear
  10304.   -- in the language binding files.
  10305.  
  10306.   // This is a comment that will appear
  10307.   // in the language binding files.
  10308.  
  10309.    # This is a comment that will not appear in the
  10310.    # language binding files.
  10311.  
  10312. Syntax of OIDL Comments 
  10313.  
  10314. Because OIDL class definition files are used to generate language bindings, 
  10315. comments must be strictly associated with particular elements so that they 
  10316. appear at the appropriate points in the output files.  If comments are not 
  10317. placed as prescribed by the OIDL syntax, they might not appear where you expect 
  10318. to see them. 
  10319.  
  10320. Throw-away comments are not intended to appear in any binding files. They can 
  10321. be placed anywhere in a class definition file. They can be used to comment out 
  10322. sections of a class definition file or to add historical or notational 
  10323. commentary. 
  10324.  
  10325.  
  10326. ΓòÉΓòÉΓòÉ 7.2.5. Processing Class Definition Files ΓòÉΓòÉΓòÉ
  10327.  
  10328. The following figure shows how a class definition file is processed by the SOM 
  10329. compiler. 
  10330.  
  10331.  Environment Variables                           C-Language Bindings
  10332. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10333. ΓöéΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé                         ΓöéΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé
  10334. ΓöéΓöé SET SMINCLUDE =Γöé  Γöé                         ΓöéΓöé.CS2Γöé Γöé.SC Γöé Γöé.PSCΓöé         Γöé
  10335. ΓöéΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     ΓöéΓööΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ         Γöé
  10336. ΓöéΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé         Γöé     Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé
  10337. ΓöéΓöé SET SMEMIT =   Γöé  Γöé         Γöé   SOM   Γöé     Γöé       Γöé.IH Γöé Γöé.PH Γöé Γöé .H Γöé  Γöé
  10338. ΓöéΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé     ΓöîΓöÇΓöÇΓöé CompilerΓöéΓöÇΓöÇΓöÇΓöÇΓöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé
  10339. ΓöéΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé     Γöé   Γöé         Γöé     Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ                Γöé
  10340. ΓöéΓöé SET SMTMP =    Γöé  Γöé     Γöé   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     Γöé       Γöé .C Γöé                Γöé
  10341. ΓöéΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé     Γöé                   Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ                Γöé
  10342. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     Γöé                   Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ                Γöé
  10343.                            Γöé                   Γöé       Γöé.DEFΓöé                Γöé
  10344.  Class Definition File     Γöé                   Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ                Γöé
  10345.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        Γöé                   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10346.  Γöé    .CSC        ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10347.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10348.  
  10349. Processing a Class Definition File 
  10350.  
  10351. The SOM compiler processes the class definition file for a SOM class and 
  10352. generates a set of language binding files.  The file name of a SOM C-language 
  10353. binding file corresponds to that of the class definition file (.CSC) processed 
  10354. by the SOM compiler.  Each SOM C-language file has a different extension.  For 
  10355. example, the SOM compiler processes EXAMPLE.CSC and generates EXAMPLE.C, 
  10356. EXAMPLE.H, and so forth. The language binding files generated by the SOM 
  10357. compiler are described in the following table. 
  10358.  
  10359. SOM C-Language Bindings Files 
  10360.  
  10361. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10362. ΓöéFile Extension ΓöéDescription                                  Γöé
  10363. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10364. Γöé.C             ΓöéTemplate for C-language source program for   Γöé
  10365. Γöé               Γöéthe class implementation.                    Γöé
  10366. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10367. Γöé.H             ΓöéPublic Include file for all C-language       Γöé
  10368. Γöé               Γöéprograms that need to access the SOM class.  Γöé
  10369. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10370. Γöé.IH            ΓöéImplementation header containing most of the Γöé
  10371. Γöé               Γöéautomatically generated implementation       Γöé
  10372. Γöé               Γöédetails about the class.                     Γöé
  10373. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10374. Γöé.PH            ΓöéMacros for private methods defined in the    Γöé
  10375. Γöé               Γöéclass.                                       Γöé
  10376. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10377. Γöé.DEF           ΓöéInstructions to the Linker about how to buildΓöé
  10378. Γöé               Γöéa class library.                             Γöé
  10379. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10380. Γöé.SC            ΓöéLanguage-neutral form and subset of the SOM  Γöé
  10381. Γöé               Γöéclass definition file with                   Γöé
  10382. Γöé               Γöéprivate-implementation detail removed. This  Γöé
  10383. Γöé               Γöéfile should be "published" (or exported, madeΓöé
  10384. Γöé               Γöéavailable) to users of the class.            Γöé
  10385. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10386. Γöé.PSC           ΓöéSupplement to .SC file that contains         Γöé
  10387. Γöé               Γöéinformation about private methods of a class.Γöé
  10388. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10389. Γöé.CS2           ΓöéStylized form of the original class          Γöé
  10390. Γöé               Γöédefinition file.                             Γöé
  10391. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10392.  
  10393. Some of these files contain the public interface for the class;  others contain 
  10394. the private interface. Some files are used to implement the class and its 
  10395. subclasses, and some are used by client programs that create and manipulate 
  10396. object instances of the class. 
  10397.  
  10398. Note:  The SOM compiler also can accept SC files as input.  In this case, only 
  10399.        the H files that are created are meaningful; but this is a major use of 
  10400.        the SOM compiler.  In those cases where only the SC files are published, 
  10401.        these files can be used to generate H files.  In order to obtain a 
  10402.        neutral H file for use with any C compiler, compile the SC file as shown 
  10403.        in the following figure. 
  10404.  
  10405. SC -s "h" -a cl386 xyz.sc
  10406.  
  10407. (SOM) Compiling .SC Files 
  10408.  
  10409. The IH and C files are the C-language source files for the class 
  10410. implementation.  The IH file is included automatically in the C file.  The SC 
  10411. file is specified in the Include section of the class definition files for 
  10412. subclasses of the class.  The H file must be included in client programs to 
  10413. create and manipulate object instances of the class.  The PH and PSC files are 
  10414. the counterparts to the IH and SC files.  These contain the private interface 
  10415. for the class and should be reserved only for class implementers who need to 
  10416. access the class's private methods. 
  10417.  
  10418. A set of environment variables, as shown in the following table, control 
  10419. SOM-compiler processing. SMTMP is optional and defaults to the root directory 
  10420. of the current drive.  If the files specified in the Include section of the 
  10421. class definition file are enclosed in double quotation marks, SMINCLUDE is 
  10422. optional and defaults to the root directory of the current drive. If the files 
  10423. specified in the Include section of the class definition file are enclosed in 
  10424. angled brackets (<>), SMINCLUDE is required for SOM-compiler processing. 
  10425. SMEMIT is used to indicate which bindings files are generated. 
  10426.  
  10427. SOM Environment Variables 
  10428.  
  10429. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10430. ΓöéVariable            ΓöéDescription                             Γöé
  10431. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10432. ΓöéSMINCLUDE           ΓöéSpecifies location of class definitions.Γöé
  10433. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10434. ΓöéSMEMIT              ΓöéSpecifies which binding files are to be Γöé
  10435. Γöé                    Γöégenerated.                              Γöé
  10436. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10437. ΓöéSMTMP               ΓöéSpecifies directory SOM can use for     Γöé
  10438. Γöé                    Γöéintermediate files.                     Γöé
  10439. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10440.  
  10441.  
  10442. ΓòÉΓòÉΓòÉ 7.2.6. A Simple Class Implementation ΓòÉΓòÉΓòÉ
  10443.  
  10444. The language binding files generated by the SOM compiler include a template for 
  10445. the C-language source program for the class implementation. This program 
  10446. template contains stub procedures for all new and override methods specified in 
  10447. the class definition file.  The application developer must supply the code 
  10448. implementation for the stub-method procedures. The following figures illustrate 
  10449. the stages in this process. 
  10450.  
  10451.   --- Dog.CSC
  10452.   ---
  10453.   --- A class defining a set of objects (dogs)
  10454.  
  10455.   #include "somobj.sc"
  10456.  
  10457.   class:  Dog;
  10458.  
  10459.   parent: SOMObject;
  10460.  
  10461.   methods:
  10462.  
  10463.      void bark();
  10464.      ---Have the dog bark.
  10465.  
  10466. Class Definition File 
  10467.  
  10468. In the above figure, the Dog class is defined.  According to this class 
  10469. definition file, the Dog class is derived from the SOMObject class. The 
  10470. behavior of the SOMObject class is defined in the file, SOMOBJ.SC, which was 
  10471. generated by the SOM compiler when the SOMObject class was implemented.  Object 
  10472. instances of the Dog class inherit the behavior of its parent class SOMObject 
  10473. by specifying the SOMOBJ.SC file in the Include section of the Dog class 
  10474. definition file.  This means that all methods that can act on instances of 
  10475. SOMObject can act on the Dog class objects. 
  10476.  
  10477. In the real world, dogs have many characteristics and behaviors.  A 
  10478. comprehensive definition of the Dog class would include methods that relate to 
  10479. these characteristics and behaviors.  For this example, the only behavior that 
  10480. is defined is barking.  The behavior, "dogs can bark" corresponds to the 
  10481. prototype of the "bark" method specified in the Methods section of the class 
  10482. definition file. 
  10483.  
  10484.    #define Dog_Class_Source
  10485.  
  10486.    #include "dog.ih"
  10487.  
  10488.    SOM_Scope void SOMLINK bark(Dog *somSelf)
  10489.       {
  10490.        DogData *somThis = DogGetData(somSelf);
  10491.        DogMethodDebug("Dog", "Bark");
  10492.       }
  10493.  
  10494. C-Language Source-Program Template for Implementation of Dog Class 
  10495.  
  10496. The SOM compiler processes the DOG.CSC file and generates the DOG.C C-language 
  10497. source-program template shown in the above figure. Notice that DOG.IH, another 
  10498. file generated by the SOM compiler, is included automatically in this program 
  10499. template.  This file contains the data structures, macros, and functions for 
  10500. accessing data and methods for object instances of the Dog class.  This file 
  10501. also provides stubs for all methods prototyped in the Methods section of the 
  10502. DOG.CSC file. The general form for a method stub is shown in the following 
  10503. figure. 
  10504.  
  10505.  
  10506.    SOM_Scope void SOMLINK <methodname>(<classname> *somSelf)
  10507.       {
  10508.        <classname>Data *somThis = <classname>GetData(somSelf);
  10509.        <classname>MethodDebug("<classname>", "<methodname>");
  10510.       }
  10511.  
  10512.  
  10513. General Form for a Method Stub 
  10514.  
  10515. SOM_Scope and SOMLINK are C macros used internally with the C-binding files. 
  10516.  
  10517. somSelf is a pointer to an object instance of the class <classname>.  Because 
  10518. the same method can be invoked on different objects but implemented differently 
  10519. (polymorphism),  a pointer to the object being operated on is required as a 
  10520. parameter in the method invocation.  The first parameter in the method 
  10521. invocation always is somSelf.  This means that if the method prototype in 
  10522. DOG.CSC for the "bark" method is specified as shown in the following figure, 
  10523. the SOM compiler generates the C-language source-program template file as shown 
  10524. in the next figure. 
  10525.  
  10526.      void bark(int x);
  10527.  
  10528. Prototype of Method with Parameters 
  10529.  
  10530.    SOM_Scope void SOMLINK bark(Dog *somSelf, int x)
  10531.       {
  10532.        DogData *somThis = DogGetData(somSelf);
  10533.        DogMethodDebug("Dog", "Bark");
  10534.       }
  10535.  
  10536. Stub of Method with Parameters 
  10537.  
  10538. The pointer somThis points to data for an object instance of the class 
  10539. <classname>. <classname>Data is a class data type automatically generated by 
  10540. the SOM compiler and placed in the IH file. 
  10541.  
  10542. <classname>GetData and <classname>MethodDebug are class macros automatically 
  10543. generated by the SOM compiler and placed in the IH file. <classname>GetData 
  10544. gets the data for the object instance (somSelf) of the class. 
  10545.  
  10546. Note:  Methods that access the object's data use the <classname>GetData macro 
  10547.        to establish addressability.  This macro must be one of the first 
  10548.        executable lines of code in each method, and the value it returns should 
  10549.        be assigned to a local variable named somThis.  The SOM compiler 
  10550.        automatically generates the code that accomplishes this in each method 
  10551.        stub in a C file. 
  10552.  
  10553. <classname>MethodDebug provides method-tracing capabilities. This custom macro 
  10554. is generated as part of the method stubs produced in the C program template. 
  10555. It takes two arguments-a class name and a method name-and if SOM_TraceLevel has 
  10556. the value 1 or 2, produces a message each time a method is entered.  (Setting 
  10557. SOM_TraceLevel to 2 also causes the methods supplied as part of the SOM runtime 
  10558. to generate method trace output.)  To suppress the generation of method tracing 
  10559. code, place a line similar to the one shown in the following figure in your C 
  10560. file after the #include statement for <classname>.IH: 
  10561.  
  10562. #define <classname>MethodDebug(c,m) SOM_NoTrace(c,m)
  10563.  
  10564. Suppressing SOM Tracing 
  10565.  
  10566. To complete the class-implementation process, the application developer 
  10567. modifies the C-language source-program template as shown in the following 
  10568. figure. The developer must supply the code for each of the stubbed method 
  10569. procedures.  In the example, "dog barking" is implemented as "printing the 
  10570. sound a dog makes," or, "printing Unknown Dog Noise."  Because the C-library 
  10571. printf routine is used to implement this function, STDIO.H also must be 
  10572. included in the source program. 
  10573.  
  10574.    #define Dog_Class_Source
  10575.  
  10576.    #include "dog.ih"
  10577.    #include <stdio.h>
  10578.  
  10579.    SOM_Scope void SOMLINK bark(Dog *somSelf)
  10580.      {
  10581.       DogData *somThis = DogGetData(somSelf);
  10582.       DogMethodDebug("Dog", "Bark");
  10583.       printf("Unknown Dog Noise"\n");
  10584.      }
  10585.  
  10586. C-language Source Program for Implementation of Dog Class 
  10587.  
  10588.  
  10589. ΓòÉΓòÉΓòÉ 7.2.7. SOM Macros, Functions, and Data ΓòÉΓòÉΓòÉ
  10590.  
  10591. To effectively use the SOM C-language bindings, an understanding of the SOM 
  10592. naming conventions is needed. These are summarized in the following table. 
  10593.  
  10594. SOM Naming Conventions 
  10595.  
  10596. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10597. ΓöéPrefix              ΓöéUse                                     Γöé
  10598. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10599. Γöésom                 ΓöéFunction and method names               Γöé
  10600. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10601. ΓöéSOM                 ΓöéData items                              Γöé
  10602. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10603.  
  10604. For example, methods for the SOM objects provided by the SOM runtime have the 
  10605. prefix, som.  Constants, data types, and pointers to functions (this includes 
  10606. macro names) have the prefix, SOM. 
  10607.  
  10608. Next, and most importantly, you need to understand SOM macros. SOM macros are 
  10609. used by class implementers and by client programs to: 
  10610.  
  10611. o Instantiate objects 
  10612. o Access object variables 
  10613. o Invoke object methods. 
  10614.  
  10615. SOM macros shield the programmer from the details and complexity of SOM data 
  10616. structures, method resolution, and function invocations. There are two types of 
  10617. SOM macros: 
  10618.  
  10619. o Class-specific 
  10620. o Non-class specific, or general. 
  10621.  
  10622.  
  10623. ΓòÉΓòÉΓòÉ 7.2.7.1. Class-Specific SOM Macros ΓòÉΓòÉΓòÉ
  10624.  
  10625. Class-specific macros resolve references to class methods, class functions, and 
  10626. class instance data.  The macro name or macro parameters contain a class method 
  10627. name, a class function name, an instance variable name, or the class name.  The 
  10628. SOM compiler automatically generates them and places them in the class Header 
  10629. files.  Class implementers can use them by including the class-implementation 
  10630. Header file (.IH) in their source programs. Client programs can use them by 
  10631. including the public class Header file (.H).  Because the IH file includes the 
  10632. H file, some class macros (those defined in the H file) are available to both 
  10633. class implementers and clients; and some (those defined in the IH file but not 
  10634. in the H file) are available only to class implementers. 
  10635.  
  10636. The simplest macro is the "_" (underscore) macro.  Object instance data can be 
  10637. referred to by preceding the name of the data element with an underscore 
  10638. character, as shown in the following figure. Underscored-data-name macros are 
  10639. defined in the H public class Header file and are available to both class 
  10640. implementers and client programs. 
  10641.  
  10642.    return _var1;
  10643.  
  10644. Underscored-Data-Name macro 
  10645.  
  10646. Object methods can be referred to similarly and invoked by preceding the method 
  10647. name with an underscore character, as shown in the following figure. 
  10648. Underscored-method-name macros also are defined in the H public class header 
  10649. file and are available to both class implementers and client programs. 
  10650.  
  10651.  
  10652.   _methodA(obj, x, y)
  10653.   /* method A, with parameters x and y, operates on object obj */
  10654.  
  10655.  
  10656. Underscored-Method-Name macro 
  10657.  
  10658. When nonrelated classes independently define methods with the same name, their 
  10659. methods can be invoked with a variation of this macro.  The method name is 
  10660. prefixed with the underscore character and class name, as shown in the 
  10661. following figure. 
  10662.  
  10663.   #include "classa.h"
  10664.   #undef _methodA
  10665.   #include "classa.h"
  10666.  
  10667.   ClassA_methodA (obj1); /* methodA, defined for ClassA objects,          */
  10668.                          /* operates on ClassA instance object obj1       */
  10669.  
  10670.   ClassB_methodA (obj2); /* methodA, defined for unrelated ClassB objects,*/
  10671.                          /* operates on ClassB instance object obj2       */
  10672.  
  10673.  
  10674. Invoking Methods with Identical Names but Nonrelated Classes 
  10675.  
  10676. Class objects also can be referred to by preceding the class name with an 
  10677. underscore character.  Underscored-class-name macros also are defined in the H 
  10678. public class Header file and are available to both class implementers and 
  10679. client programs. 
  10680.  
  10681. Other class-specific macros are summarized in the following table. 
  10682.  
  10683. Class-Specific Macros 
  10684.  
  10685. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10686. ΓöéFunction                      ΓöéMacros                        Γöé
  10687. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10688. ΓöéInstantiate objects           Γöé<classname>New                Γöé
  10689. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10690. Γöé                              Γöé<classname>Renew              Γöé
  10691. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10692. ΓöéAccess instance data          Γöéget_<instance variable>,      Γöé
  10693. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10694. Γöé                              Γöé<classname>GetData            Γöé
  10695. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10696. ΓöéInvoke methods                ΓöéSOM_Resolve                   Γöé
  10697. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10698. Γöé                              ΓöéSOM_ResolveNoCheck            Γöé
  10699. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10700. ΓöéInvoke parent methods         Γöéparent_<methodname>           Γöé
  10701. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10702. Γöé                              ΓöéSOM_ParentResolve             Γöé
  10703. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10704. ΓöéTrace methods                 Γöé<classname>MethodDebug        Γöé
  10705. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10706.  
  10707. Of the macros listed in the preceding table, <classname>GetData and the parent 
  10708. method macros are defined in the IH file, but not in the H file.  They are 
  10709. available only for class implementers. 
  10710.  
  10711. A class-specific function also is defined in the H file associated with a 
  10712. class.  This function, <classname>NewClass, creates the class object.  It is 
  10713. invoked automatically when an object is instantiated through the <classname>New 
  10714. class macro. 
  10715.  
  10716.  
  10717. ΓòÉΓòÉΓòÉ 7.2.7.2. General SOM Macros and Functions ΓòÉΓòÉΓòÉ
  10718.  
  10719. SOM provides a set of non-class-specific, or general SOM macros and functions 
  10720. that support: 
  10721.  
  10722. o ID manipulation 
  10723. o Debugging 
  10724. o Error handling 
  10725. o Getting object information. 
  10726.  
  10727. General SOM macros are defined in the SOM.H Header file. Because SOM.H is 
  10728. included in the class header (H and IH) files, SOM macros are available to 
  10729. class implementers and client programs. 
  10730.  
  10731.  
  10732. ΓòÉΓòÉΓòÉ 7.2.7.2.1. SOM ID Manipulation ΓòÉΓòÉΓòÉ
  10733.  
  10734. IDs are numbers that uniquely represent strings.  They can be used in SOM to 
  10735. identify method names, class names, and descriptors. Typically, they are used 
  10736. to provide a fast and efficient means of comparing the strings they represent. 
  10737.  
  10738. SOM provides a set of macros and functions, as shown in the following table, 
  10739. that can be used to manipulate SOM IDs. 
  10740.  
  10741. Macros and Functions for Manipulating SOM IDs 
  10742.  
  10743. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10744. ΓöéType                ΓöéInterface                               Γöé
  10745. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10746. ΓöéMacros              ΓöéSOM_CheckID                             Γöé
  10747. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10748. Γöé                    ΓöéSOM_CompareIDs                          Γöé
  10749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10750. Γöé                    ΓöéSOM_StringFromID                        Γöé
  10751. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10752. Γöé                    ΓöéSOM_IDFromString                        Γöé
  10753. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10754. ΓöéFunctions           ΓöésomRegisterId                           Γöé
  10755. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10756. Γöé                    ΓöésomUniqueKey                            Γöé
  10757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10758. Γöé                    ΓöésomTotalRegIds                          Γöé
  10759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10760. Γöé                    ΓöésomSetExpectedIds                       Γöé
  10761. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10762. Γöé                    ΓöésomBeginPersistentIds                   Γöé
  10763. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10764. Γöé                    ΓöésomEndPersistentIds                     Γöé
  10765. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10766.  
  10767. Initially an ID is a pointer to a string. A SOM ID automatically is converted 
  10768. to an internal ID representation by the SOM_CheckID macro or by the first 
  10769. invocation of any of the ID manipulation macros.  Because the representation of 
  10770. an ID changes, SOM IDs are of a special data type (somId). 
  10771.  
  10772.  
  10773. ΓòÉΓòÉΓòÉ 7.2.7.2.2. SOM Debugging ΓòÉΓòÉΓòÉ
  10774.  
  10775. The SOM run-time library provides a means of generating character output by 
  10776. invoking macros and functions that call a replaceable SOM procedure called 
  10777. SOMOutCharRoutine. These macros and functions are available to assist the 
  10778. application developer with debugging an application.  Output generated by the 
  10779. debug macros can be conditionally suppressed or produced based on the setting 
  10780. of four global variables. The following table summarizes the SOM debugging 
  10781. macros and the global variables that affect them. 
  10782.  
  10783. SOM Debug Macros and Control Variables 
  10784.  
  10785. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10786. ΓöéMacro                         ΓöéControl Variables             Γöé
  10787. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10788. ΓöéSOM_TestC                     ΓöéSOM_WarnLevel                 Γöé
  10789. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10790. ΓöéSOM_WarnMsg                   ΓöéSOM_WarnLevel                 Γöé
  10791. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10792. ΓöéSOM_Assert                    ΓöéSOM_AssertLevel               Γöé
  10793. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10794. ΓöéSOM_Expect                    ΓöéSOM_WarnLevel                 Γöé
  10795. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10796.  
  10797. In addition to the debug macros, SOM provides a function, somPrintf, that 
  10798. unconditionally generates character output.  The interface to somPrintf is 
  10799. identical to the C-library printf routine. 
  10800.  
  10801.  
  10802. ΓòÉΓòÉΓòÉ 7.2.7.2.3. SOM Error Handling ΓòÉΓòÉΓòÉ
  10803.  
  10804. The SOM run-time library also provides a way to handle SOM errors by invoking 
  10805. macros (SOM_ERROR and SOM_TEST) that call a replaceable SOM procedure called 
  10806. SomError.  SomError produces a message, an error code and, if appropriate, can 
  10807. end the process where the error occurred.  SOM errors are classified by 
  10808. severity, which is indicated in the low-order digit of the SOM error code. 
  10809. There are three SOM error classes, or severity levels, as shown in the 
  10810. following table. 
  10811.  
  10812. SOM Error Severity Levels 
  10813.  
  10814. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10815. ΓöéSeverity Level          ΓöéDescription                         Γöé
  10816. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10817. ΓöéSOM_Ignore              ΓöéNormal and informational only       Γöé
  10818. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10819. ΓöéSOM_Warn                ΓöéAbnormal but not unrecoverable      Γöé
  10820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10821. ΓöéSOM_Fatal               ΓöéAbnormal and unrecoverable          Γöé
  10822. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10823.  
  10824.  
  10825. ΓòÉΓòÉΓòÉ 7.2.7.2.4. Getting SOM Object Information ΓòÉΓòÉΓòÉ
  10826.  
  10827. A SOM class implementer or client program can easily determine the class of an 
  10828. object by invoking the SOM_GetClass macro.  This macro returns a pointer to the 
  10829. class object.  All SOM class objects support methods (for example, 
  10830. somGetInstanceSize) that return information about the objects they create. 
  10831. Therefore, by determining the class of an object and invoking class object 
  10832. methods, more can be learned about the original object. 
  10833.  
  10834.  
  10835. ΓòÉΓòÉΓòÉ 7.2.7.2.5. Replaceable SOM Functions ΓòÉΓòÉΓòÉ
  10836.  
  10837. The SOM run-time environment uses SOM functions that perform memory management, 
  10838. DLL management, character output, and error handling. These functions are 
  10839. replaceable, which means that you can override them by supplying your own 
  10840. version of the default SOM functions. Replaceable SOM functions are summarized 
  10841. in the followig table. 
  10842.  
  10843. Replaceable SOM Functions 
  10844.  
  10845. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10846. ΓöéCategory                      ΓöéFunctions                     Γöé
  10847. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10848. ΓöéMemory Management             ΓöéSOMCalloc                     Γöé
  10849. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10850. Γöé                              ΓöéSOMFree                       Γöé
  10851. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10852. Γöé                              ΓöéSOMMalloc                     Γöé
  10853. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10854. Γöé                              ΓöéSOMRealloc                    Γöé
  10855. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10856. ΓöéDLL Management                ΓöéSOMClassInitFuncName          Γöé
  10857. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10858. Γöé                              ΓöéSOMDeleteModule               Γöé
  10859. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10860. Γöé                              ΓöéSOMLoadModule                 Γöé
  10861. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10862. ΓöéCharacter Output              ΓöéSOMOutCharRoutine             Γöé
  10863. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10864. ΓöéError Handling                ΓöéSOMError                      Γöé
  10865. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10866.  
  10867. The following figure shows how a user-defined function can be substituted for 
  10868. one of the replaceable SOM functions. 
  10869.  
  10870.    #include <som.h>
  10871.    /* Define your replacement routine                                  */
  10872.    int myReplacementForSOMOutCharRoutine (char c)
  10873.    {
  10874.         (Your code goes here.)
  10875.    }
  10876.    .
  10877.    .
  10878.    .
  10879.    /* After the next statement all output will be sent to your routine */
  10880.    SOMOutCharRoutine = myReplacementForSOMOutCharRoutine;
  10881.  
  10882. Replacing SOM Functions 
  10883.  
  10884.  
  10885. ΓòÉΓòÉΓòÉ 7.2.8. Invoking Methods and Accessing Data ΓòÉΓòÉΓòÉ
  10886.  
  10887. The basic rules for invoking methods and accessing object data can be 
  10888. summarized as follows: 
  10889.  
  10890. o Object data can be referred to by preceding the name of the data element with 
  10891.   an underscore character. This is valid only in a method of the class, and 
  10892.   then only for the object being operated on. 
  10893.  
  10894. o Methods can be invoked by preceding the method name with an underscore 
  10895.   character.  Method parameters always include a pointer to the object being 
  10896.   operated on.  Invocation of instance methods requires a pointer to an 
  10897.   instance object.  Invocation of class methods requires a pointer to a class 
  10898.   object. 
  10899.  
  10900. These rules can be illustrated by introducing three new methods for the Dog 
  10901. class that relate to more dog characteristics and getting and setting 
  10902. behaviors. Because dogs can be characterized by their breed, a user should be 
  10903. able to get and set the breed for a dog.  It also would be desirable to view or 
  10904. display the characteristics of a dog. In the following figure, the action of 
  10905. getting and setting a dog's breed corresponds to the prototype for the getBreed 
  10906. and setBreed methods in the DOG.CSC file.  The action of displaying a dog's 
  10907. characteristics corresponds to the prototype for the display method. 
  10908.  
  10909.   --- Dog.CSC
  10910.   ---
  10911.   --- A class defining a set of objects (dogs)
  10912.  
  10913.   #include "somobj.sc"
  10914.  
  10915.   class:  Dog;
  10916.  
  10917.   parent: SOMObject;
  10918.  
  10919.   data:
  10920.      char breed[100]
  10921.  
  10922.   methods:
  10923.      void setBreed(char *myBreed);
  10924.      ---Set the breed of this dog.
  10925.  
  10926.      char *getBreed();
  10927.      ---Get the breed of this dog.
  10928.  
  10929.      void display();
  10930.      ---Display characteristics of this dog.
  10931.      ---Display its breed and have it bark.
  10932.  
  10933.      void bark();
  10934.      ---Have the dog bark.
  10935.  
  10936. Invoking Methods and Accessing Data in a New Dog Class (DOG.CSC)
  10937.  
  10938. The above figure also introduces the use of instance data that supports methods 
  10939. that can operate on dog objects.  Each dog has its own copy of the instance 
  10940. data associated with it. In this example,  the breed of a dog is stored in a 
  10941. string called "breed".  The setBreed method fills the string with the 
  10942. appropriate characters.  The getBreed method gets the contents of the string. 
  10943.  
  10944. From the new DOG.CSC file, the SOM compiler generates a new C-language 
  10945. source-program template, which is used to complete the implementation of the 
  10946. new Dog class, as shown in the following figure. 
  10947.  
  10948.    #define Dog_Class_Source
  10949.  
  10950.    #include "dog.ih"
  10951.    #include <string.h>
  10952.    #include <stdio.h>
  10953.  
  10954.    SOM_Scope char *SOMLINK setBreed(Dog *somSelf, char *myBreed)
  10955.       {
  10956.        DogData *somThis = DogGetData(somSelf);
  10957.        DogMethodDebug("Dog", "setBreed");
  10958.        strcpy(_breed, myBreed);
  10959.       }
  10960.  
  10961.    SOM_Scope char *SOMLINK getBreed(Dog *somSelf)
  10962.       {
  10963.        DogData *somThis = DogGetData(somSelf);
  10964.        DogMethodDebug("Dog", "getBreed");
  10965.        return _breed;
  10966.       }
  10967.  
  10968.    SOM_Scope void SOMLINK display(Dog *somSelf)
  10969.       {
  10970.        DogData *somThis = DogGetData(somSelf);
  10971.        DogMethodDebug("Dog", "display");
  10972.        printf ("\nMy breed is %s\n,
  10973.                _getBreed(somSelf));
  10974.        printf ("I say\n");
  10975.        _bark(somSelf);
  10976.       }
  10977.  
  10978.    SOM_Scope void SOMLINK bark(Dog *somSelf)
  10979.       {
  10980.        DogData *somThis = DogGetData(somSelf);
  10981.        DogMethodDebug("Dog", "Bark");
  10982.        printf ("Unknown Dog Noise\n");
  10983.       }
  10984.  
  10985. Implementation of a New Dog Class (DOG.C)
  10986.  
  10987. The first thing that is noticeable in the above figure is that the 
  10988. instance-data declarations are not present.  They have been placed in the 
  10989. class-implementation file (DOG.IH) by the SOM compiler. As before, DOG.IH 
  10990. contains all the definitions of the Dog class data, macros, and functions. 
  10991.  
  10992. The setBreed and getBreed methods operate on the string, "breed" and refer to 
  10993. it by prefixing the string name with the underscore character.  The setBreed 
  10994. method uses the C-library routine, strcpy, to fill the string with the dog's 
  10995. breed, as specified as a parameter to the method.  To resolve the reference to 
  10996. strcpy, STRING.H is included in the source program. 
  10997.  
  10998. The display method requires that the dog's characteristics (that is, its breed 
  10999. and its bark) are displayed.  To do this, the display method calls both the 
  11000. getBreed and bark methods, which are referenced by prefixing the method name 
  11001. with the underscore character. 
  11002.  
  11003. Finally, as in the previous implementation of the Dog class, the Include file, 
  11004. STDIO.H, is added to the source program to resolve the reference to the 
  11005. C-library routine, printf, which is used to display the dog's characteristics. 
  11006. The SOM function, somPrintf, can be used in place of printf; no additional 
  11007. Include file is required in this case.  In fact, it is recommended that SOM 
  11008. class implementations use the SOM functions, where appropriate, instead of the 
  11009. C-library functions.  SOM functions offer flexibility and replaceability. 
  11010.  
  11011.  
  11012. ΓòÉΓòÉΓòÉ 7.2.9. A SOM Client Program ΓòÉΓòÉΓòÉ
  11013.  
  11014. So far, the examples have shown how to define and implement SOM classes, but 
  11015. have only mentioned SOM client programs.  SOM client programs are applications 
  11016. that create and manipulate SOM objects. 
  11017.  
  11018. A SOM client of the new Dog class can, for simplicity, create an instance of 
  11019. the Dog class, define its breed, and display its characteristics. This simple 
  11020. SOM client is shown in the following figure. 
  11021.  
  11022.    #include "dog.h"
  11023.  
  11024.    int main()
  11025.    {
  11026.       Dog *Zack;
  11027.       Zack = DogNew();
  11028.       _setBreed(Zack, "Yorkshire Terrier");
  11029.       _display(Zack);
  11030.       _somFree(Zack);
  11031.       return 0;
  11032.    }
  11033.  
  11034. Client of the New Dog Class 
  11035.  
  11036. To create and manipulate SOM objects, a client program must have access to the 
  11037. object's public methods.  In the same way that class data, methods, and 
  11038. functions are available to class implementers through the .IH file associated 
  11039. with the class implementation, class data methods and functions are available 
  11040. to client programs through the .H file associated with the class 
  11041. implementation.  In the client program example in the above figure, DOG.H is 
  11042. included to resolve references to the dog object's public methods. 
  11043.  
  11044. In the example, the variable Zack is defined as a pointer to an instance 
  11045. (object) of the Dog class.  In general, a pointer to an instance of a class is 
  11046. declared as shown in the following figure. 
  11047.  
  11048.   <classname> *object;
  11049.  
  11050. Defining an Object 
  11051.  
  11052. The DogNew Dog class macro then is used to create an instance of the Dog class 
  11053. and return the pointer in the variable Zack.  DogNew is defined in DOG.H and is 
  11054. a method inherited from the parent (SOMObject) of the Dog class and tailored 
  11055. for the Dog class.  The DogNew macro expands to invoke the somNew method. 
  11056. somNew invokes the DogNewClass function, which creates the Dog class object, if 
  11057. it has not yet been created.  The Dog class object must be created before its 
  11058. instances can be created.  If instances of the Dog class are created through 
  11059. some mechanism other than DogNew, the DogNewClass function must be invoked in 
  11060. the client program. 
  11061.  
  11062. Because the setBreed and display methods are public and are defined in DOG.H, 
  11063. the client program can invoke them in the same manner as the class 
  11064. implementation:  by prefixing the method name with the underscore character. 
  11065. In the client program, the pointer to the dog object (Zack) is the first 
  11066. parameter for these methods.  The setBreed method is called to set Zack's breed 
  11067. as "Yorkshire Terrier."  The display method invokes the getBreed and bark 
  11068. methods and prints the dog's breed and bark. 
  11069.  
  11070. Finally, the somFree method releases resources allocated when an object is 
  11071. created by somNew.  As previously mentioned, somNew is invoked by the DogNew 
  11072. macro.  The somFree method, like somNew, is a method inherited from the parent 
  11073. (SOMObject) of the Dog class. The somFree method must be called if somNew is 
  11074. used to create an object. 
  11075.  
  11076. The output from the client program is shown in the following figure. 
  11077.  
  11078.    My breed is Yorkshire Terrier
  11079.    I say
  11080.    Unknown Dog Noise
  11081.  
  11082. Output from Client of Dog Class 
  11083.  
  11084.  
  11085. ΓòÉΓòÉΓòÉ 7.2.10. Inheritance and Polymorphism:  Overriding Methods ΓòÉΓòÉΓòÉ
  11086.  
  11087. In the Dog class example, the Dog class is derived from SOMObject.  Object 
  11088. instances of the Dog class inherit SOMObject behavior; that is, all SOMObject 
  11089. methods can operate on instances of the Dog class.  In addition, the Dog class 
  11090. example defined methods not defined for SOMObject.  The Dog class is a subclass 
  11091. of SOMObject. 
  11092.  
  11093. Note:  All classes are derived, either directly or indirectly, from SOMObject. 
  11094.  
  11095. LittleDogs and BigDogs, subclasses of the Dog class, can be defined. These 
  11096. subclasses inherit the behavior of their parent class (Dog class), as well as 
  11097. the behavior of their parent's parent class (SOMObject).  If the Dog class had 
  11098. been derived from other classes that were derived from SOMObject, the new 
  11099. subclasses would also inherit the behavior of these ancestor classes. In 
  11100. addition to adding new methods to those inherited from ancestor classes, 
  11101. subclasses can modify or override any inherited methods. 
  11102.  
  11103. The inheritance relationship between the new subclasses (LittleDog and BigDog) 
  11104. and their ancestors (Dog and SOMObject) is shown in the following figure. 
  11105.  
  11106.      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11107.      Γöé          Γöé        Γöé          ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöéLittleDogs Γöé
  11108.      Γöé          Γöé        Γöé          Γöé      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11109.      Γöé SOMObjectΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé   Dogs   Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11110.      Γöé          Γöé        Γöé          ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöé BigDogs   Γöé
  11111.      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11112.  
  11113. Inheritance Relationships Between Classes and Subclasses 
  11114.  
  11115. LittleDogs and BigDogs can be differentiated by the sound, or bark, they make. 
  11116. For this example, instead of making an "Unknown dog noise," little dogs "Yap" 
  11117. and big dogs "WOOF."  This means that the LittleDog and BigDog classes 
  11118. implement the bark method inherited from the Dog class differently.  In the 
  11119. class definition files for the LittleDog and BigDog classes (the following two 
  11120. figures), this is indicated as a method override. 
  11121.  
  11122.    include "dog.sc"
  11123.  
  11124.    class:  LittleDog;
  11125.  
  11126.    parent:  Dog;
  11127.  
  11128.    methods:
  11129.       override bark;
  11130.  
  11131. LDOG.CSC-LittleDog Class Definition File 
  11132.  
  11133.    include "dog.sc"
  11134.  
  11135.    class:  BigDog;
  11136.  
  11137.    parent:  Dog;
  11138.  
  11139.    methods:
  11140.       override bark;
  11141.  
  11142. BDOG.CSC-BigDog Class Definition File 
  11143.  
  11144. Because the parent of the LittleDog and BigDog classes is the Dog class, DOG.SC 
  11145. must be included in the class definition files so that methods of the Dog class 
  11146. are inherited and can be referenced. 
  11147.  
  11148. The implementations of the LittleDog and BigDog classes are similar to the 
  11149. implementation of the Dog class.  In the implementation of the LittleDog class, 
  11150. as shown in the following figure, the Include file, LDOG.IH, contains the 
  11151. definitions for LittleDog class data, macros, and functions.  The 
  11152. implementation of the bark method reflects the yapping of little dogs. 
  11153.  
  11154.    #define LittleDog_Class_Source
  11155.    #include "ldog.ih"
  11156.    #include <stdio.h>
  11157.  
  11158.    SOM_Scope void SOMLINK bark(LittleDog *somSelf)
  11159.    {
  11160.      LittleDogData *somThis = LittleDogGetData(somSelf);
  11161.      LittleDogMethodDebug("LittleDog","bark");
  11162.      printf("yap yap\n");
  11163.      printf("yap yap\n");
  11164.    }
  11165.  
  11166. LDOG.C-LittleDog Class Implementation 
  11167.  
  11168. In the implementation of the BigDog class, as shown in the following figure, 
  11169. the Include file, BDOG.IH, contains the definitions for BigDog class data, 
  11170. macros, and functions.  The implementation of the bark method reflects the 
  11171. WOOFing of big dogs. 
  11172.  
  11173.    #define BigDog_Class_Source
  11174.    #include "bdog.ih"
  11175.    #include <stdio.h>
  11176.  
  11177.    SOM_Scope void SOMLINK bark(BigDog *somSelf)
  11178.    {
  11179.      BigDogData *somThis = BigDogGetData(somSelf);
  11180.      BigDogMethodDebug("BigDog","bark");
  11181.      printf("WOOF WOOF\n");
  11182.      printf("WOOF WOOF\n");
  11183.      printf("WOOF WOOF\n");
  11184.      printf("WOOF WOOF\n");
  11185.    }
  11186.  
  11187. BDOG.C-BigDog Class Implementation 
  11188.  
  11189. For a client program of the Dog, BigDog, and LittleDog classes to access public 
  11190. methods for these classes, the client program must include the public class 
  11191. Header (H) files for the respective classes.  In the following figure, the 
  11192. client of these classes includes DOG.H,LDOG.H, and BDOG.H files. The next 
  11193. figure shows the output from this client program. 
  11194.  
  11195.    #include "dog.h"
  11196.    #include "ldog.h"
  11197.    #include "bdog.h"
  11198.  
  11199.    int main()
  11200.    {
  11201.       Dog *Pokey;
  11202.       LittleDog *Zack;
  11203.       BigDog *Pepper;
  11204.  
  11205.    /* Set pointers to instantiated objects
  11206.       ------------------------------------*/
  11207.       Pokey = DogNew();
  11208.       Zack = LittleDogNew();
  11209.       Pepper = BigDogNew();
  11210.  
  11211.    /* Set their breeds
  11212.       ------------------------------------*/
  11213.       _setBreed(Pokey, "Basset Hound");
  11214.       _setBreed(Zack, "Yorkshire Terrier");
  11215.       _setBreed(Pepper, "Rottweiler");
  11216.  
  11217.    /* Display dog characteristics
  11218.       ------------------------------------*/
  11219.       _display(Pokey);
  11220.       _display(Zack);
  11221.       _display(Pepper);
  11222.  
  11223.    /* Free objects
  11224.       ------------------------------------*/
  11225.       _somFree(Pokey);
  11226.       _somFree(Zack);
  11227.       _somFree(Pepper);
  11228.       return 0;
  11229.    }
  11230.  
  11231. Client of Dog, BigDog, and LittleDog Classes 
  11232.  
  11233.    My breed is Basset Hound
  11234.    I say
  11235.    Unknown Dog Noise
  11236.  
  11237.    My breed is Yorkshire Terrier
  11238.    I say
  11239.    yap yap
  11240.    yap yap
  11241.  
  11242.    My breed is Rottweiler
  11243.    I say
  11244.    WOOF WOOF
  11245.    WOOF WOOF
  11246.    WOOF WOOF
  11247.    WOOF WOOF
  11248.  
  11249. Output from Client of Dog, BigDog, and LittleDog Classes 
  11250.  
  11251.  
  11252. ΓòÉΓòÉΓòÉ 7.2.11. Metaclasses ΓòÉΓòÉΓòÉ
  11253.  
  11254. In the implementation of the Dog, BigDog, and LittleDog classes, a metaclass is 
  11255. not specified in the Metaclass section of the class definition files. This 
  11256. means that the metaclass of each of these classes is the metaclass of their 
  11257. parent class.  The metaclass of the BigDog and LittleDog classes is the 
  11258. metaclass of its parent class (Dog).  The metaclass of the Dog class is the 
  11259. metaclass of its parent class (SOMObject),  and the metaclass of the SOMObject 
  11260. class is SOMClass. SOMClass, then, supplies the constructors for the Dog, 
  11261. BigDog, and LittleDog classes, as well as for SOMObject. 
  11262.  
  11263. If a metaclass is specified in the Metaclass section of the class definition 
  11264. files, a new metaclass is defined for the classes. The new metaclass provides 
  11265. new constructors for the classes. As an example, if a new metaclass, DogMeta, 
  11266. is defined for the Dog class, the class definition file for this class is shown 
  11267. in the following figure. 
  11268.  
  11269.   include <somcls.sc>
  11270.  
  11271.   class:  DogMeta;
  11272.  
  11273.   parent:  SOMClass;
  11274.  
  11275.   methods:
  11276.     SOMAny *newDog();
  11277.     --Create an instance of the dog class
  11278.  
  11279. DOGMETA.CSC-Class Definition for Metaclass of Dog Class 
  11280.  
  11281. Because SOMClass is the root class for all metaclasses, DogMeta is derived from 
  11282. SOMClass.  This is reflected in the Parent and Include sections in the class 
  11283. definition file for the DogMeta class. The only method that DogMeta defines is 
  11284. newDog, the constructor that creates an instance of the dog class. 
  11285.  
  11286.   #define DogMeta_Class_Source
  11287.   #include "dogmeta.ih"
  11288.   #include "dog.h"
  11289.  
  11290.   SOM_SCOPE SOMAny *SOMLINK newDog(DogMeta * somSelf)
  11291.      {
  11292.       DogMetaData *somThis = DogMetaGetData(somSelf);
  11293.       DogMetaMethodDebug("DogMeta", "newDog");
  11294.       Dog *aDog;
  11295.       aDog=_somNew(somSelf);
  11296.       return(aDog);
  11297.      }
  11298.  
  11299. DOGMETA.C-Implementation of DogMeta Class 
  11300.  
  11301. The implementation of the DogMeta class, as shown in the above figure, is 
  11302. similar to the implementation of the Dog class.  However, DOGMETA.C is also a 
  11303. client of the Dog class:  the newDog method returns a pointer to an instance of 
  11304. the Dog class.  To resolve this data type during the C-language compilation of 
  11305. DOGMETA.C, DOG.H must be included. 
  11306.  
  11307. Before the C-language compilation of DOGMETA.C is done, the Dog class 
  11308. definition file must be redefined to associate the new metaclass with the Dog 
  11309. class.  The new class definition file for the Dog Class is shown in the 
  11310. following figure. 
  11311.  
  11312.   --- Dog.CSC
  11313.   ---
  11314.   --- A class defining a set of objects (dogs)
  11315.  
  11316.   include "dogmeta.sc"
  11317.   include "somobj.sc"
  11318.  
  11319.   class:  Dog;
  11320.  
  11321.   metaclass:  DogMeta;
  11322.  
  11323.   parent: SOMObject;
  11324.  
  11325.   methods:
  11326.  
  11327.      void bark();
  11328.      ---Have the dog bark.
  11329.  
  11330.  
  11331. DOG.CSC-Associating a Metaclass with a Class 
  11332.  
  11333. The new Dog class definition file has a Metaclass section.  The SC file 
  11334. associated with the DogMeta metaclass is now required in the Include section. 
  11335. When the SOM compiler processes DOG.CSC, it generates a new DOG.H file that 
  11336. includes DOGMETA.H. 
  11337.  
  11338. The final implementation of the new Dog class is identical to the previous 
  11339. example.  Clients of the Dog class, however, instantiate instances of the Dog 
  11340. class differently, as shown in the following figure. 
  11341.  
  11342.    #include "dog.h"
  11343.  
  11344.    int main()
  11345.    {
  11346.       DogNewClass(Dog_MajorVersion, Dog_MinorVersion);
  11347.  
  11348.       Dog *Zack;
  11349.  
  11350.       Zack = _newDog();
  11351.       _setBreed(Zack, "Yorkshire Terrier");
  11352.       _display(Zack);
  11353.       _somFree(Zack);
  11354.       return 0;
  11355.    }
  11356.  
  11357.  
  11358. Client of Dog and DogMeta Classes 
  11359.  
  11360. The constructor method (that is, the method that creates instances of an 
  11361. object) for the Dog class is now newDog. In the previous examples, the DogNew 
  11362. macro was used to instantiate Dog objects. Because the DogNew macro invokes the 
  11363. DogNewClass function to create the Dog class object, the previous client 
  11364. programs did not have to invoke DogNewClass directly.  Because the 
  11365. implementation of the newDog method does not call the DogNewClass function, the 
  11366. new client program is required to do so. 
  11367.  
  11368. The parameters for the DogNewClass function are defined by the class 
  11369. implementer in the DOG.CSC file. MajorVersion and MinorVersion are attributes 
  11370. defined in the Class section of the class definition file and used by the 
  11371. DogNewClass function to determine compatibility with versions of the class 
  11372. library. In this example, Dog_MajorVersion and Dog_MinorVersion have not been 
  11373. previously defined in the CLASS section of the DOG.CSC file. 
  11374.  
  11375.  
  11376. ΓòÉΓòÉΓòÉ 7.2.12. Implied Metaclasses ΓòÉΓòÉΓòÉ
  11377.  
  11378. If a metaclass is not specified in the Metaclass section of a class definition 
  11379. file, the class's metaclass, by default, is its parent's metaclass.  This was 
  11380. demonstrated in the earliest Dog class examples.  If a class's metaclass is 
  11381. different from its parent's metaclass, then it must be specified in the 
  11382. Metaclass section of the class definition file.  This was demonstrated in the 
  11383. latest Dog class example.  The same process can be followed to derive a class's 
  11384. metaclass from its parent (that is, create a subclass of the parent's 
  11385. metaclass).  This requires a separate CSC file and generates associated binding 
  11386. files for each class and metaclass. 
  11387.  
  11388. A subclass of a parent's metaclass can be created also by using implied 
  11389. metaclasses.  This is accomplished by defining new and overriding existing 
  11390. class methods within the class's CSC file. 
  11391.  
  11392. Using the earliest Dog class example, an implied metaclass can be used to add a 
  11393. function to the Dog class object to keep count of the dog population.  The 
  11394. class definition file for the Dog class with an implied metaclass is shown in 
  11395. the following figure. 
  11396.  
  11397.    #include "somobj.sc"
  11398.  
  11399.    class:  Dog, local, class=DogClass_;
  11400.  
  11401.    parent:  SOMObject;
  11402.  
  11403.    data:
  11404.        char breed[100];
  11405.        int dogCount, class;
  11406.  
  11407.    methods:
  11408.        void setBreed(char *myBreed);
  11409.        ---Set the Breed of this Dog.
  11410.        .
  11411.        .
  11412.        .
  11413.        override somInit, class;
  11414.        ---Initialize the dog counter to zero.
  11415.  
  11416.        SOMAny *somNew(), class;
  11417.        ---Increment the count of number of dogs.
  11418.        ---Create a dog object.
  11419.  
  11420.        int countDogs(), class;
  11421.        ---Return count of number of dogs.
  11422.  
  11423. DOG.CSC-Implied Metaclass for the Dog Class 
  11424.  
  11425. In this example, the CLASS attribute is specified in both the Data and Method 
  11426. sections of the class definition. The CLASS attribute in the method prototypes 
  11427. indicates that the methods are new or overrides to existing class methods 
  11428. defined in the metaclass (SOMClass) of the parent of the Dog class.  The CLASS 
  11429. attribute in the data declarations indicates that the data is associated with 
  11430. the class methods. 
  11431.  
  11432. The Class section also contains a prefix specification (DogClass_) for class 
  11433. methods that are defined in this class definition file. The implementation of 
  11434. the Dog class and its implied metaclass, as shown in the following figure, is 
  11435. similar to the previous examples. 
  11436.  
  11437.    #define Dog_Class_Source
  11438.  
  11439.    #include "dog.ih"
  11440.    #undef SOM_CurrentClass
  11441.    #define SOM_CurrentClass \ DogClassData.parentMtab
  11442.  
  11443.    #include <string.h>
  11444.    #include <stdio.h>
  11445.  
  11446.    /*  Same Dog Methods as before       */
  11447.  
  11448.    #undef SOM_CurrentClass
  11449.    #define SOM_CurrentClass \ M_DogClassData.parentMtab
  11450.  
  11451.    SOM_SCOPE void SOMLINK DogClass_somInit(M_Dog *somSelf)
  11452.      {
  11453.       M_DogData *somThis = M_DogGetData(somSelf);
  11454.       parent_somInit(somSelf);
  11455.       _dogCount = 0;
  11456.      }
  11457.  
  11458.    SOM_Scope SOMAny* SOMLINK DogClass_somNew(M_Dog *somSelf)
  11459.      {
  11460.       M_DogData *somThis = M_DogGetData(somSelf);
  11461.       -dogCount++;
  11462.       return parent_somNew(somSelf);
  11463.      }
  11464.  
  11465.    SOM_Scope int SOMLINK DogClass_countDogs(M_Dog *somSelf)
  11466.      {
  11467.       M_DogData *somThis = M_DogGetData(somSelf);
  11468.       return _dogCount;
  11469.      }
  11470.  
  11471. Implementation of an Implied Metaclass for the Dog Class 
  11472.  
  11473. SOM_CurrentClass is used to separate the implementation of the instance methods 
  11474. from the implementation of the class methods. The class methods defined in 
  11475. DOG.CSC are prefixed with DogClass_, as indicated in the Class section of the 
  11476. DOG.CSC file. 
  11477.  
  11478. When an implied metaclass is used to define a subclass of a parent's metaclass, 
  11479. SOM defines a metaclass that is separate from either the class or its parent's 
  11480. metaclass.  The class data, macros, methods, and functions related to this 
  11481. class have the prefix, M_.  For example, somSelf is defined as a pointer to an 
  11482. instance of the metaclass, M_Dog, that is, to the Dog class object. A client of 
  11483. the Dog class with an implied metaclass is shown in the following figure. 
  11484.  
  11485.    #include "dog.h"
  11486.  
  11487.    #include <stdio.h>
  11488.  
  11489.    int main()
  11490.    {
  11491.      Dog *dog1;
  11492.      Dog *dog2;
  11493.  
  11494.      SOMClass *DogMeta;
  11495.  
  11496.      dog1 = DogNew();
  11497.      dog2 = Dognew();
  11498.  
  11499.      DogMeta = _somGetClass(dog1);
  11500.  
  11501.      printf("Count of dogs:  %d\n",
  11502.         _countDogs(DogMeta));
  11503.  
  11504.      _somFree(dog1);
  11505.      _somFree(dog2);
  11506.      return 0;
  11507.    }
  11508.  
  11509. A Client of the Dog Class with an Implied Metaclass 
  11510.  
  11511. The client program defines DogMeta as a pointer to a class object.  The 
  11512. _somGetClass method inherited from the parent (SOMObject) of the Dog class is 
  11513. used to get a pointer to the Dog class object.  Finally, the class method, 
  11514. countDogs is invoked by the Dog class object. 
  11515.  
  11516.  
  11517. ΓòÉΓòÉΓòÉ 7.2.13. Building SOM Class Libraries ΓòÉΓòÉΓòÉ
  11518.  
  11519. Two basic rules explain the process of building SOM class libraries: 
  11520.  
  11521. o SC files for a class's metaclass, parent class, or ancestor class are 
  11522.   required for the SOM compiler to process a class definition file.  These 
  11523.   files establish the relationships between classes. 
  11524.  
  11525. o H files are required for C-language compiler processing and building of the 
  11526.   class library.  These files resolve references to methods defined in other 
  11527.   files. 
  11528.  
  11529. With these rules in mind, the basic process for building a SOM class library 
  11530. can be summarized as follows: 
  11531.  
  11532.  1. Create CSC files and do SOM compilation for all parent and ancestor classes 
  11533.     and their related classes. 
  11534.  
  11535.  2. Create CSC files for a class and its metaclass (if any). 
  11536.  
  11537.  3. Do a SOM compilation of the metaclass CSC file. 
  11538.  
  11539.  4. Do a SOM compilation of the class CSC file. 
  11540.  
  11541.  5. Do C-language compilations of C implementation files, in any order. 
  11542.  
  11543.  
  11544. ΓòÉΓòÉΓòÉ 7.2.14. SOM ANIMALS Sample Program in the OS/2 2.0 Toolkit ΓòÉΓòÉΓòÉ
  11545.  
  11546. The ANIMALS program introduces a programmer to basic SOM and object-oriented 
  11547. programming concepts.  It defines six classes whose relationship corresponds to 
  11548. a zoological classification of animals.  The classes and their relationships 
  11549. are shown in the following figure. 
  11550.  
  11551.           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        metaclass       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11552.           ΓöéSOMObjectΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé   SOMClass   Γöé
  11553.           ΓööΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11554.               Γöé                                     Γöé
  11555.           ΓöîΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        metaclass       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11556.           Γöé  Animal ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé AnimalFactoryΓöé
  11557.           ΓööΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11558.               Γöé                                     Γöé
  11559.           ΓöîΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ        metaclass       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11560.           Γöé   Dog   ΓöéΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöé   DogFactory Γöé
  11561.           ΓööΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ                        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11562.             Γöé    Γöé
  11563.     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÉ ΓöîΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11564.     Γöé BigDog Γöé Γöé LittleDogΓöé
  11565.     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11566.  
  11567. Class Relationships in ANIMALS Sample Program 
  11568.  
  11569. The ANIMALS sample program is an expansion of the Dog class examples that have 
  11570. been used throughout this chapter.  BigDog and LittleDog are subclasses of the 
  11571. Dog class. Dog is a subclass of the Animal class, which is a subclass of 
  11572. SOMObject. DogFactory is a subclass of AnimalFactory, which is a subclass of 
  11573. SOMClass. SOMClass and AnimalFactory provide constructor methods for the Animal 
  11574. class.  SOMClass, AnimalFactory, and DogFactory provide constructor methods for 
  11575. the Dog, BigDog, and LittleDog classes. 
  11576.  
  11577. The class definition of the dog classes in the ANIMALS sample program, includes 
  11578. the color of a dog, as well as the breed and sound it makes. Methods in the 
  11579. class definition file are grouped according to the type of function (for 
  11580. example, GetMethods, SetMethods, DisplayMethods, SystemMethodOverrides, 
  11581. AnimalMethodOverrides, parentOverrides). 
  11582.  
  11583.  
  11584. ΓòÉΓòÉΓòÉ 7.2.15. SOM ANIMALS Sample Program with Implied Metaclasses ΓòÉΓòÉΓòÉ
  11585.  
  11586. The classes defined in the ANIMALS program can be restructured to use implied 
  11587. metaclasses.  This eliminates the need for class definition files for the 
  11588. AnimalFactory and DogFactory metaclasses.  The source code for the ANIMALS 
  11589. sample program with implied metaclasses is not included in the OS/2 2.0 
  11590. Toolkit, but is provided in the following nine figures. 
  11591.  
  11592.    #include <somobj.sc>
  11593.  
  11594.    class: Animal, local, classprefix = m_;
  11595.  
  11596.    parent: SOMObject;
  11597.  
  11598.    passthru: C.h;
  11599.    /* this is a passthru line */
  11600.    endpassthru;
  11601.  
  11602.    data:
  11603.      char *sound;
  11604.      int  nsound;
  11605.      int  cdata, classdata;
  11606.  
  11607.    methods:
  11608.  
  11609.    group: SetMethods;
  11610.  
  11611.       void setSound(char *mySound);
  11612.    -- Tell the animal what kind of a sound it makes.
  11613.  
  11614.    group: GetMethods;
  11615.  
  11616.       char *getGenus();
  11617.    -- Returns the genus of animal.
  11618.    -- This method should be overridden by derived classes.
  11619.    -- The default version here just gives "unknown" as the genus.
  11620.  
  11621.       char *getSpecies();
  11622.    -- Returns the species of animal.
  11623.    -- This method should be overridden by derived classes.
  11624.    -- The default version here just gives "unknown" as the species.
  11625.  
  11626.    group: DisplayMethods;
  11627.  
  11628.       void talk();
  11629.    -- Ask the animal to talk.  Normally this just prints the
  11630.    -- string set by setSound(), but it can be overridden to do something
  11631.    -- else.
  11632.  
  11633.       void display();
  11634.    -- Displays an animal.  Derived classes should override this to
  11635.    -- display new derived information, and then call their parent
  11636.    -- version. Note: this method makes use of talk() to describe what
  11637.    -- the animal says.
  11638.  
  11639.    group: SystemMethodOverrides;
  11640.  
  11641.       override somInit, classmethod;
  11642.       override somInit;
  11643.    -- This method will be invoked when a new animal is created.
  11644.  
  11645.       override somUninit;
  11646.    -- This is invoked when an animal object is freed.
  11647.  
  11648.       override somDumpSelfInt;
  11649.    -- Invoked when an animal is deleted.
  11650.  
  11651.    group: Constructors;
  11652.  
  11653.       SOMAny * newAnimal(char *sound), classmethod;
  11654.    -- Create an instance of an animal with a specific sound.
  11655.  
  11656.       int getCdata(),classmethod;
  11657.  
  11658. ANIMAL.CSC-ANIMALS with Implied Metaclasses 
  11659.  
  11660.    #define SOM_NoTest
  11661.    #define Animal_Class_Source
  11662.    #include "animal.ih"
  11663.    #include <string.h>
  11664.  
  11665.    SOM_Scope char *SOMLINK getGenus(Animal * somSelf)
  11666.    {
  11667.        AnimalData *somThis = AnimalGetData(somSelf);
  11668.        AnimalMethodDebug("Animal", "getGenus");
  11669.        return ("Unknown Genus");
  11670.    }
  11671.  
  11672.    SOM_Scope char *SOMLINK getSpecies(Animal * somSelf)
  11673.    {
  11674.        AnimalData *somThis = AnimalGetData(somSelf);
  11675.        AnimalMethodDebug("Animal", "getSpecies");
  11676.        return ("Unknown Species");
  11677.    }
  11678.  
  11679.    SOM_Scope void SOMLINK setSound(Animal * somSelf,
  11680.                                     char *mySound)
  11681.    {
  11682.        AnimalData *somThis = AnimalGetData(somSelf);
  11683.        AnimalMethodDebug("Animal", "setSound");
  11684.  
  11685.        if (_sound)
  11686.            (*SOMFree) (_sound);
  11687.        _sound = (char *) (*SOMMalloc) (strlen(mySound) + 1);
  11688.        strcpy(_sound, mySound);
  11689.    }
  11690.  
  11691.    SOM_Scope void SOMLINK talk(Animal * somSelf)
  11692.    {
  11693.        AnimalData *somThis = AnimalGetData(somSelf);
  11694.        AnimalMethodDebug("Animal", "talk");
  11695.        somPrintf("%s\n", _sound);
  11696.    }
  11697.  
  11698.    SOM_Scope void SOMLINK display(Animal * somSelf)
  11699.    {
  11700.        AnimalData *somThis = AnimalGetData(somSelf);
  11701.        AnimalMethodDebug("Animal", "display");
  11702.        somPrintf("  Genus: %s\n", _getGenus(somSelf));
  11703.        somPrintf("Species: %s\n", _getSpecies(somSelf));
  11704.        somPrintf("This Animal says\n");
  11705.        _talk(somSelf);
  11706.    }
  11707.  
  11708.    SOM_Scope void SOMLINK somInit(Animal * somSelf)
  11709.    {
  11710.        AnimalData *somThis = AnimalGetData(somSelf);
  11711.        AnimalMethodDebug("Animal", "somInit");
  11712.        parent_somInit(somSelf);
  11713.        _sound = (char *) NULL;
  11714.    }
  11715.  
  11716.    SOM_Scope void SOMLINK somUninit(Animal * somSelf)
  11717.    {
  11718.        AnimalData *somThis = AnimalGetData(somSelf);
  11719.        AnimalMethodDebug("Animal", "somUninit");
  11720.        if (_sound)
  11721.            (*SOMFree) (_sound);
  11722.        parent_somUninit(somSelf);
  11723.    }
  11724.  
  11725.    SOM_Scope void SOMLINK somDumpSelfInt(Animal * somSelf,
  11726.                                           int level)
  11727.    {
  11728.        AnimalData *somThis = AnimalGetData(somSelf);
  11729.        AnimalMethodDebug("Animal", "somDumpSelfInt");
  11730.        _display(somSelf);
  11731.        parent_somDumpSelfInt(somSelf, level);
  11732.    }
  11733.  
  11734.    #undef SOM_CurrentClass
  11735.    #define SOM_CurrentClass M_AnimalCClassData.parentMtab
  11736.    SOM_Scope void   SOMLINK m_somInit(M_Animal *somSelf)
  11737.    {
  11738.        M_AnimalData *somThis = M_AnimalGetData(somSelf);
  11739.        M_AnimalMethodDebug("M_Animal","m_somInit");
  11740.  
  11741.        _cdata = 1234;
  11742.        parent_somInit(somSelf);
  11743.    }
  11744.  
  11745.    /*
  11746.     *  Create an instance of an animal with a specific sound.
  11747.     */
  11748.  
  11749.    SOM_Scope SOMAny *  SOMLINK m_newAnimal(M_Animal *somSelf,
  11750.                    char *sound)
  11751.    {
  11752.        M_AnimalData *somThis = M_AnimalGetData(somSelf);
  11753.        Animal *animal = _somNew(somSelf);
  11754.        M_AnimalMethodDebug("M_Animal","m_newAnimal");
  11755.  
  11756.        _setSound(animal, sound);
  11757.        return (animal);
  11758.    }
  11759.  
  11760.    #undef SOM_CurrentClass
  11761.    #define SOM_CurrentClass M_AnimalCClassData.parentMtab
  11762.    SOM_Scope int   SOMLINK m_getCdata(M_Animal *somSelf)
  11763.    {
  11764.        M_AnimalData *somThis = M_AnimalGetData(somSelf);
  11765.        M_AnimalMethodDebug("M_Animal","m_getCdata");
  11766.  
  11767.        return (int) _cdata;
  11768.    }
  11769.  
  11770. ANIMAL.C-ANIMALS with Implied Metaclasses 
  11771.  
  11772.    #include "animal.sc"
  11773.    #include "somcls.sc"
  11774.  
  11775.    class: Dog, local, classprefix = m_;
  11776.  
  11777.    parent: Animal;
  11778.  
  11779.    data:
  11780.      char *breed;
  11781.      char *color;
  11782.      char *classcolor,  classdata;
  11783.  
  11784.    methods:
  11785.  
  11786.    group: SetMethods;
  11787.  
  11788.       void setBreed(char *myBreed);
  11789.    -- Set the breed of this dog.
  11790.  
  11791.       void setColor(char *myColor);
  11792.    -- Set the color of this dog.
  11793.  
  11794.    group: GetMethods;
  11795.  
  11796.       char *getBreed();
  11797.    -- Get the breed of this dog.
  11798.  
  11799.       char *getColor();
  11800.    -- Get the color of this dog.
  11801.  
  11802.    group: AnimalOverrides;
  11803.  
  11804.       override getGenus;
  11805.    -- This overrides the animal version.  This returns the genus
  11806.    -- of a dog.
  11807.  
  11808.       override getSpecies;
  11809.    -- This overrides the animal version.  This returns the species
  11810.    -- of a dog.
  11811.  
  11812.       override display;
  11813.    -- Displays a dog.  This method displays the color and breed, and then
  11814.    -- invokes the parent display to show information about the animal.
  11815.    -- The parent display will invoke talk() to show what the animal says.
  11816.    -- The version of talk() defined by Animal uses private Animal data
  11817.    -- to determine how the animal talks.  But talk() is a method that will
  11818.    -- be redefined by later derivations of Dog;  namely, LittleDog and
  11819.    -- BigDog.  Both of these classes redefine the talk() method.  So
  11820.    -- when a LittleDog invokes display(), which will be inherited from
  11821.    -- this version, the following sequence occurs:
  11822.    --   1. Dog::display() is invoked.
  11823.    --   2. Dog::display() invokes Animal::display().
  11824.    --   3. Animal::display() invokes talk(), which has been overridden
  11825.    --      by LittleDog().
  11826.    --   4. LittleDog::talk() uses a different algorithm for talking
  11827.    --      than Animal::talk() uses.
  11828.  
  11829.    group: SystemMethodOverrides;
  11830.  
  11831.       override somInit;
  11832.    -- This method will be invoked when a new dog is created.
  11833.    -- The reason this is automatically invoked is that Dog
  11834.    -- is derived from Animal, and Animal uses SOMClassInit
  11835.    -- as its metaclass.
  11836.  
  11837.       override somUninit;
  11838.    -- This method is invoked when a Dog object is freed.
  11839.  
  11840.       override somDumpSelfInt;
  11841.    -- Invoked when a dog is deleted.
  11842.  
  11843.       override somNew, classmethod;
  11844.  
  11845.    group: Constructors;
  11846.  
  11847.       SOMAny * newDog(char *sound, char *breed, char *color), classmethod;
  11848.    -- Create an instance of a dog with a specific sound, breed, and color.
  11849.  
  11850. DOG.CSC-ANIMALS with Implied Metaclasses 
  11851.  
  11852.    #define Dog_Class_Source
  11853.  
  11854.    #include "dog.ih"
  11855.    #include <string.h>
  11856.  
  11857.    SOM_Scope char *SOMLINK getBreed(Dog * somSelf)
  11858.    {
  11859.        DogData *somThis = DogGetData(somSelf);
  11860.        DogMethodDebug("Dog", "getBreed");
  11861.  
  11862.        return _breed;
  11863.    }
  11864.  
  11865.    SOM_Scope char *SOMLINK getColor(Dog * somSelf)
  11866.    {
  11867.        DogData *somThis = DogGetData(somSelf);
  11868.        DogMethodDebug("Dog", "getColor");
  11869.  
  11870.        return _color;
  11871.    }
  11872.  
  11873.    SOM_Scope void SOMLINK setBreed(Dog * somSelf, char *myBreed)
  11874.    {
  11875.        DogData *somThis = DogGetData(somSelf);
  11876.        DogMethodDebug("Dog", "setBreed");
  11877.  
  11878.        if (_breed)
  11879.            (*SOMFree) (_breed);
  11880.        _breed = (char *) (*SOMMalloc) (strlen(myBreed) + 1);
  11881.        strcpy(_breed, myBreed);
  11882.    }
  11883.  
  11884.    SOM_Scope void SOMLINK setColor(Dog * somSelf, char *myColor)
  11885.    {
  11886.        DogData *somThis = DogGetData(somSelf);
  11887.        DogMethodDebug("Dog", "setColor");
  11888.  
  11889.        if (_color)
  11890.            (*SOMFree) (_color);
  11891.        _color = (char *) (*SOMMalloc) (strlen(myColor) + 1);
  11892.        strcpy(_color, myColor);
  11893.    }
  11894.  
  11895.    SOM_Scope void SOMLINK somInit(Dog * somSelf)
  11896.    {
  11897.        DogData *somThis = DogGetData(somSelf);
  11898.        DogMethodDebug("Dog", "somInit");
  11899.        parent_somInit(somSelf);
  11900.  
  11901.        _color = 0;
  11902.        _breed = 0;
  11903.    }
  11904.  
  11905.    SOM_Scope void SOMLINK somUninit(Dog * somSelf)
  11906.    {
  11907.        DogData *somThis = DogGetData(somSelf);
  11908.        DogMethodDebug("Dog", "somUninit");
  11909.  
  11910.        if (_color)
  11911.            (*SOMFree) (_color);
  11912.        if (_breed)
  11913.            (*SOMFree) (_breed);
  11914.        parent_somUninit(somSelf);
  11915.    }
  11916.    SOM_Scope void SOMLINK somDumpSelfInt(Dog * somSelf,
  11917.                                           int level)
  11918.    {
  11919.        DogData *somThis = DogGetData(somSelf);
  11920.        DogMethodDebug("Dog", "somDumpSelfInt");
  11921.        parent_somDumpSelfInt(somSelf, level);
  11922.    }
  11923.  
  11924.    SOM_Scope char *SOMLINK getGenus(Dog * somSelf)
  11925.    {
  11926.        DogData *somThis = DogGetData(somSelf);
  11927.        DogMethodDebug("Dog", "getGenus");
  11928.        return ("Canis");
  11929.    }
  11930.  
  11931.    SOM_Scope char *SOMLINK getSpecies(Dog * somSelf)
  11932.    {
  11933.        DogData *somThis = DogGetData(somSelf);
  11934.        DogMethodDebug("Dog", "getSpecies");
  11935.        return ("Familiaris");
  11936.    }
  11937.  
  11938.    SOM_Scope void SOMLINK display(Dog * somSelf)
  11939.    {
  11940.        DogData *somThis = DogGetData(somSelf);
  11941.        DogMethodDebug("Dog", "display");
  11942.        somPrintf("  Breed: %s\n", _getBreed(somSelf));
  11943.        somPrintf("  Color: %s\n", _getColor(somSelf));
  11944.        parent_display(somSelf);
  11945.    }
  11946.  
  11947.    /*
  11948.     *  Create an instance of a dog with a specific sound, breed, and color.
  11949.     */
  11950.  
  11951.    SOM_Scope SOMAny *  SOMLINK m_newDog(M_Dog *somSelf,
  11952.                    char *sound,
  11953.                    char *breed,
  11954.                    char *color)
  11955.    {
  11956.        M_DogData *somThis = M_DogGetData(somSelf);
  11957.        Dog *dog = _newAnimal(somSelf, sound);
  11958.        M_DogMethodDebug("M_Dog","m_newDog");
  11959.  
  11960.        _setBreed(dog, breed);
  11961.        _setColor(dog, color);
  11962.        return (dog);
  11963.    }
  11964.  
  11965. DOG.C-ANIMALS with Implied Metaclasses 
  11966.  
  11967.    include "dog.sc"
  11968.  
  11969.    class: BigDog, local;
  11970.  
  11971.    parent: Dog;
  11972.  
  11973.    methods:
  11974.  
  11975.    group: parentOverrides;
  11976.       override talk;
  11977.    -- Overrides Dog::talk().  See display() in Dog for a discussion
  11978.    -- of how this changes the display() of a BigDog.
  11979.  
  11980. BDOG.CSC-ANIMALS with Implied Metaclasses 
  11981.  
  11982.    #define BigDog_Class_Source
  11983.    #include "bdog.ih"
  11984.  
  11985.    /*
  11986.     *  Overrides Dog::talk().  See display() in Dog for a discussion
  11987.     *  of how this changes the display() of a BigDog.
  11988.     */
  11989.  
  11990.    SOM_Scope void   SOMLINK talk(BigDog *somSelf)
  11991.    {
  11992.        /* BigDogData *somThis = BigDogGetData(somSelf); */
  11993.        BigDogMethodDebug("BigDog","talk");
  11994.  
  11995.        somPrintf("WOOF WOOF\n");
  11996.        somPrintf("WOOF WOOF\n");
  11997.        somPrintf("WOOF WOOF\n");
  11998.        somPrintf("WOOF WOOF\n");
  11999.        somSelf;
  12000.    }
  12001.  
  12002. BDOG.C- ANIMALS with Implied Metaclasses 
  12003.  
  12004.    include "dog.sc"
  12005.  
  12006.    class: LittleDog, local;
  12007.  
  12008.    parent: Dog;
  12009.  
  12010.    methods:
  12011.  
  12012.    group: parentOverrides;
  12013.  
  12014.       override talk;
  12015.    -- Overrides the Dog::talk().  See display() in Dog for a discussion
  12016.    -- of how this changes the display() of a LittleDog.
  12017.  
  12018. LDOG.CSC-ANIMALS with Implied Metaclasses 
  12019.  
  12020.    #define LittleDog_Class_Source
  12021.    #include "ldog.ih"
  12022.  
  12023.    SOM_Scope void SOMLINK talk(LittleDog * somSelf)
  12024.    {
  12025.    /*  LittleDogData *somThis = LittleDogGetData(somSelf); */
  12026.        LittleDogMethodDebug("LittleDog", "talk");
  12027.        somPrintf("woof woof\n");
  12028.        somPrintf("woof woof\n");
  12029.        somSelf;   /* Avoid "Unreferenced parameter" compiler warning */
  12030.    }
  12031.  
  12032. LDOG.C-ANIMALS with Implied Metaclasses 
  12033.  
  12034.    #include "animal.h"
  12035.    #include "dog.h"
  12036.    #include "ldog.h"
  12037.    #include "bdog.h"
  12038.  
  12039.    void main(int argc)
  12040.    {
  12041.        Animal *myAnimal;
  12042.        Dog *myDog;
  12043.        LittleDog *myLittleDog;
  12044.        BigDog *myBigDog;
  12045.  
  12046.        /*
  12047.         * Create classes.
  12048.         */
  12049.        AnimalNewClass(Animal_MajorVersion, Animal_MinorVersion);
  12050.        DogNewClass(Dog_MajorVersion, Dog_MinorVersion);
  12051.        LittleDogNewClass(LittleDog_MajorVersion, LittleDog_MinorVersion);
  12052.        BigDogNewClass(BigDog_MajorVersion, BigDog_MinorVersion);
  12053.  
  12054.        SOM_TraceLevel = (argc > 1 ? 1 : 0);
  12055.  
  12056.        /*
  12057.         * Create objects using constructors
  12058.         */
  12059.        myAnimal = _newAnimal(_Animal, "Roar!!!");
  12060.        myDog = _newDog(_Dog, "Grrr", "Retriever", "Yellow");
  12061.        myLittleDog = _newDog(_LittleDog, "unknown noise",
  12062.                              "French Poodle", "Black");
  12063.        myBigDog = _newDog(_BigDog, "unknown noise",
  12064.                           "German Shepherd", "Brown");
  12065.  
  12066.        /*
  12067.         * Display objects.
  12068.         */
  12069.        somPrintf("=====================\n");
  12070.        somPrintf("myAnimal:\n");
  12071.        _display(myAnimal);
  12072.  
  12073.        somPrintf("=====================\n");
  12074.        somPrintf("myDog:\n");
  12075.        _display(myDog);
  12076.  
  12077.        somPrintf("=====================\n");
  12078.        somPrintf("myLittleDog:\n");
  12079.        _display(myLittleDog);
  12080.  
  12081.        somPrintf("=====================\n");
  12082.        somPrintf("myBigDog:\n");
  12083.        _display(myBigDog);
  12084.  
  12085.        /*
  12086.         * Free objects.
  12087.         */
  12088.        somPrintf("\n");
  12089.        _somFree(myAnimal);
  12090.        _somFree(myDog);
  12091.        _somFree(myLittleDog);
  12092.        _somFree(myBigDog);
  12093.  
  12094.        somPrintf("Test successfully completed\n");
  12095.        exit(0);
  12096.    }
  12097.  
  12098. MAIN.C-Client of ANIMALS with Implied Metaclasses 
  12099.  
  12100.  
  12101. ΓòÉΓòÉΓòÉ 7.2.16. Summary ΓòÉΓòÉΓòÉ
  12102.  
  12103. Summary of SOM and Object-Oriented Programming Terminology 
  12104.  
  12105. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12106. ΓöéTerm                ΓöéDefinition                              Γöé
  12107. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12108. ΓöéObject              ΓöéSet of data and actions that can be     Γöé
  12109. Γöé                    Γöéperformed on that data.                 Γöé
  12110. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12111. ΓöéClass               ΓöéGeneric description of sets of objects  Γöé
  12112. Γöé                    Γöéand their behavior.                     Γöé
  12113. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12114. ΓöéClass object        ΓöéRun-time implementation of a class.     Γöé
  12115. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12116. ΓöéInstance object     ΓöéAn object belonging to a certain class. Γöé
  12117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12118. ΓöéMethod              ΓöéActions that can be performed on an     Γöé
  12119. Γöé                    Γöéobject.                                 Γöé
  12120. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12121. ΓöéInstance method     ΓöéActions that can be performed on        Γöé
  12122. Γöé                    Γöéinstances of class objects.             Γöé
  12123. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12124. ΓöéClass method        ΓöéActions that can be performed on class  Γöé
  12125. Γöé                    Γöéobjects; also known as factory methods. Γöé
  12126. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12127. ΓöéMetaclass           ΓöéClass of a class.  Defines class methodsΓöé
  12128. Γöé                    Γöéfor a class object.                     Γöé
  12129. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12130. ΓöéImplied metaclass   ΓöéSubclassing metaclass of parent class   Γöé
  12131. Γöé                    Γöéwithout separate CSC for resultant      Γöé
  12132. Γöé                    Γöémetaclass.                              Γöé
  12133. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12134. ΓöéClient program      ΓöéApplication that creates and manipulatesΓöé
  12135. Γöé                    Γöéinstances of classes.                   Γöé
  12136. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12137. ΓöéOIDL                ΓöéObject Interface Definition Language;   Γöé
  12138. Γöé                    Γöéspecification language for SOM class    Γöé
  12139. Γöé                    Γöédefinitions.                            Γöé
  12140. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12141. ΓöéInheritance         ΓöéImplications of derivation of new       Γöé
  12142. Γöé                    Γöéclasses from existing classes.  Child   Γöé
  12143. Γöé                    Γöéclasses inherit methods of parent and   Γöé
  12144. Γöé                    Γöéancestor classes.                       Γöé
  12145. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12146. ΓöéSubclass            ΓöéChild classes that define new behavior  Γöé
  12147. Γöé                    Γöéin terms of new methods not inherited   Γöé
  12148. Γöé                    Γöéfrom parent and ancestor classes.       Γöé
  12149. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12150. ΓöéPolymorphism        ΓöéDifferent implementations of the same   Γöé
  12151. Γöé                    Γöémethod for two or more classes.         Γöé
  12152. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12153. ΓöéMethod override     ΓöéPolymorphism in SOM;  child classes can Γöé
  12154. Γöé                    Γöéoverride the implementation of methods  Γöé
  12155. Γöé                    Γöéinherited from parent and ancestor      Γöé
  12156. Γöé                    Γöéclasses.                                Γöé
  12157. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12158. ΓöéEncapsulation       ΓöéThe private, or internal view, of an    Γöé
  12159. Γöé                    Γöéobject that describes how data and      Γöé
  12160. Γöé                    Γöémethods are actually implemented.       Γöé
  12161. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12162.  
  12163.  
  12164. ΓòÉΓòÉΓòÉ 8. Workplace Programming Interface ΓòÉΓòÉΓòÉ
  12165.  
  12166. This chapter describes: 
  12167.  
  12168. o CUA Guidelines for an Object-Oriented User Interface 
  12169. o The OS/2 2.0 Object-Oriented User Interface: The Workplace 
  12170. o The OS/2 2.0 Workplace Programming Interface. 
  12171.  
  12172. To establish a base definition of an object-oriented user interface, CUA 
  12173. guidelines are highlighted.  The OS/2 Workplace Shell is an object-oriented 
  12174. user environment based on these guidelines.  General object-oriented user 
  12175. interface concepts described in CUA guidelines are then used to explain the 
  12176. underlying design of the Workplace Programming Interface.  For complete 
  12177. information on CUA guidelines, see Systems Application Architecture:  Common 
  12178. User Access Guide to User Interface Design in the OS/2 2.0 Technical Library. 
  12179.  
  12180. Because Workplace objects are built using the IBM System Object Model (SOM), 
  12181. the OS/2 2.0 Workplace Programming Interface requires a knowledge of SOM.  This 
  12182. chapter assumes a knowledge of object-oriented programming and design concepts, 
  12183. as well as SOM. For more information on writing object-oriented programs using 
  12184. SOM, see Object-Oriented Programming Using SOM.  For reference information on 
  12185. the Object Definition Interface Language used to construct SOM classes, the 
  12186. predefined SOM classes and methods, and the SOM compiler, see the System Object 
  12187. Model Guide and Reference in the OS/2 2.0 Technical Library. 
  12188.  
  12189. So that you can develop your own Workplace objects, class definition files for 
  12190. Workplace objects supported by the Shell are provided with the Toolkit.  For 
  12191. detailed descriptions of Workplace classes and methods and the Workplace API, 
  12192. see the Presentation Manager Programming Reference, Volume II in the OS/2 2.0 
  12193. Technical Library. 
  12194.  
  12195.  
  12196. ΓòÉΓòÉΓòÉ 8.1. CUA Guidelines for an Object-Oriented User Interface ΓòÉΓòÉΓòÉ
  12197.  
  12198. Prior to 1991, CUA guidelines defined the user interface for 
  12199. application-oriented environments.  In application-oriented environments, such 
  12200. as OS/2 1.X, the user performs tasks by starting an application.  The user 
  12201. starts an application by selecting an installed program from a list of programs 
  12202. displayed in a window or by entering the program name at a command-line prompt. 
  12203. For example, the user can start an editor to create and edit a file, start a 
  12204. spreadsheet application to create and update a spreadsheet, or can send a file 
  12205. to a printer to print it. 
  12206.  
  12207. In 1991, CUA guidelines defined the user interface for object-oriented 
  12208. environments.  In object-oriented environments, such as OS/2 2.0, the user 
  12209. performs tasks by manipulating on-screen objects.  The user does not start an 
  12210. application to perform a task.  Instead, the user can do the following: 
  12211.  
  12212. o Select an action or task that can be performed on an object.  For example, 
  12213.   the user selects the Open action on an ASCII file object.  The operating 
  12214.   system then starts an editor to work on the file. 
  12215.  
  12216. o Select the open action on a spreadsheet file.  The operating system then 
  12217.   starts a spreadsheet application to work on the file. 
  12218.  
  12219. o Drag the ASCII file object to a printer object and drop it on the printer 
  12220.   object.  The file is then sent to the printer. 
  12221. The concept of applications is transparent to the user.  The user interacts 
  12222. with objects rather than with the operating system or with separate 
  12223. applications.  The user focuses on the task and not on the tools used to 
  12224. perform the task.  The user interacts with objects in the same manner across 
  12225. tasks. 
  12226.  
  12227.  
  12228. ΓòÉΓòÉΓòÉ 8.1.1. Objects, Classes, Hierarchies, and Inheritance ΓòÉΓòÉΓòÉ
  12229.  
  12230. An object is any visual component of the user interface with which the user can 
  12231. work, independent of other items, to perform a task.  An object can be 
  12232. represented by one or more graphic images, called icons.  The user can interact 
  12233. with an object (or its icon) just as the user can interact with objects in the 
  12234. real world. 
  12235.  
  12236.  
  12237. ΓòÉΓòÉΓòÉ 8.1.2. Views of Objects ΓòÉΓòÉΓòÉ
  12238.  
  12239. The user also can interact with an object by opening a window that displays 
  12240. more information about the object.  The content of a window is a view of an 
  12241. object. A view is a way of looking at an object's information.  Different views 
  12242. display information in different forms, just as information about an object is 
  12243. presented in the real world.  An object can have more than one view. 
  12244.  
  12245. The appearance of a window's contents and the kinds of interaction possible in 
  12246. a window are determined, in part, by the type of view presented in the window. 
  12247. CUA guidelines describe four basic types of views: 
  12248.  
  12249. o Composed Views 
  12250.  
  12251.   A composed view of a data object arranges the object's data in an order that 
  12252.   conveys the data's meaning.  If the data is arranged differently in a 
  12253.   composed view, the object has a different meaning.  For example,  a graph or 
  12254.   chart object typically is displayed in a composed view because the 
  12255.   arrangement of the components determines the meaning of the object as a 
  12256.   whole.  If the arrangement of the components changes, the meaning of the 
  12257.   object changes. 
  12258.  
  12259. o Contents Views 
  12260.  
  12261.   A contents view lists the components of an object.  The components can be 
  12262.   ordered or unordered in the view;  the order of the information displayed in 
  12263.   a contents view does not affect the meaning of the object containing the 
  12264.   information.  CUA guidelines describe two kinds of contents views: 
  12265.  
  12266.    - Icon view 
  12267.  
  12268.      An icon view displays each object as an icon.  Its purpose is to give the 
  12269.      user an easy way to change the position of objects or to otherwise 
  12270.      directly manipulate them. 
  12271.  
  12272.      An object usually is represented by only one icon.  However, for some 
  12273.      tasks, the user might find it convenient to represent an object with more 
  12274.      than one icon.  For example, the user might want a representation of a 
  12275.      printer object in more than one place so that the user can have easy 
  12276.      access to the printer from anywhere.  The user can create an additional 
  12277.      icon, known as a shadow, to represent the same printer object. 
  12278.  
  12279.    - Details view 
  12280.  
  12281.      A details view combines small icons with text that provides additional 
  12282.      information about objects.  The type of information displayed depends on 
  12283.      the type of object and the type of tasks the user wants to perform.  A 
  12284.      details view gives the user access to some of the object's more frequently 
  12285.      used information, without requiring the user to open the object.  Small 
  12286.      icons are included in a details view to provide a way for the user to 
  12287.      easily recognize objects and to directly manipulate each object. 
  12288.  
  12289. o Settings Views 
  12290.  
  12291.   A settings view displays information about the characteristics, attributes, 
  12292.   or properties of an object, and provides a way for the user to change the 
  12293.   settings of some characteristics or properties.  A settings view typically is 
  12294.   provided for each type of object. 
  12295.  
  12296. o Help Views 
  12297.  
  12298.   A help view provides information that can assist the user in working with an 
  12299.   object.  The type of information displayed in a help view depends on the type 
  12300.   of help the user requests.  For example,  the user can request help for an 
  12301.   entire window or for part of a window. 
  12302.  
  12303.  
  12304. ΓòÉΓòÉΓòÉ 8.1.3. Classes of Objects ΓòÉΓòÉΓòÉ
  12305.  
  12306. Objects can be classified by similarities in characteristics and behavior. 
  12307. Each class of objects has a primary purpose that distinguishes it from other 
  12308. classes, and all three types of objects can contain other objects.  CUA 
  12309. guidelines define three object classes: 
  12310.  
  12311. o Container Objects 
  12312.  
  12313.   A container object holds other objects.  Its primary purpose is to provide a 
  12314.   way for the user to group related objects for easy access and retrieval. 
  12315.  
  12316. o Data Objects 
  12317.  
  12318.   Data objects convey information, such as text or graphics, audio or video 
  12319.   information. 
  12320.  
  12321. o Device Objects 
  12322.  
  12323.   A device object often represents a physical object in the real world. For 
  12324.   example, a mouse object can represent the user's pointing device, and a modem 
  12325.   object can represent the user's modem.  Some device objects represent a 
  12326.   logical object in the user's computer system rather than a physical object. 
  12327.   For example, a shredder object can represent a logical object that disposes 
  12328.   of the user's other objects. Some device objects can contain other objects. 
  12329.   For example, a printer object can contain a queue of objects to be printed. 
  12330.  
  12331.  
  12332. ΓòÉΓòÉΓòÉ 8.1.4. Object Relationships ΓòÉΓòÉΓòÉ
  12333.  
  12334. An object class can be defined in terms of another object class.  It can be 
  12335. derived from another class, inheriting the same characteristics and behavior of 
  12336. the other class, yet having characteristics and behavior of its own.  The class 
  12337. that it is derived from is called its parent class;  the class itself is 
  12338. referred to as a subclass of its parent class. 
  12339.  
  12340. The inheritance relationship between objects is hierarchical.  An object that 
  12341. is lower in the inheritance hierarchy than another object has all of the 
  12342. characteristics of the object or objects above it and can have new 
  12343. characteristics of its own. 
  12344.  
  12345. Other object relationships also can be hierarchical.  For example, objects can 
  12346. be arranged in a containment hierarchy that illustrates which objects can 
  12347. contain which other objects. 
  12348.  
  12349.  
  12350. ΓòÉΓòÉΓòÉ 8.1.5. Interaction with Objects ΓòÉΓòÉΓòÉ
  12351.  
  12352. In an object-oriented user environment, users interact with objects to perform 
  12353. tasks.  The object-action paradigm is a pattern for interaction in which the 
  12354. user first selects an object, then selects an action.  When the user selects an 
  12355. object, the system can then present a list of actions that can be applied to 
  12356. that object.  Some actions might require the user to respond to additional 
  12357. choices.  Interaction with an object through choices and controls is known as 
  12358. indirect manipulation. 
  12359.  
  12360. At any given time an object has a set of actions that can be performed on it. 
  12361. Different objects have different actions that can be performed on them.  Action 
  12362. choices for an object are displayed in pop-up menus that appear next to an 
  12363. object when the user presses the appropriate key or mouse button.  The content 
  12364. of a pop-up menu is based on the object's context, which includes its current 
  12365. state, location, and contents. 
  12366.  
  12367. Users also can interact with objects by way of a pointing device.  This is 
  12368. known as direct manipulation.  This interaction technique closely resembles the 
  12369. way the user interacts with objects in the real world.  For example,  the user 
  12370. can pick up an object and put it into a folder.  This is also known as dragging 
  12371. an object from one place and dropping it at another place. 
  12372.  
  12373. Drag and drop often involves a source object and a  target object.  A source 
  12374. object usually is the object the user is working with, and a target object 
  12375. usually is an object to which the user is transferring information.  For 
  12376. example, the user drags a file object to a printer object so that the file can 
  12377. be printed; the file is the source object and the printer is the target object. 
  12378.  
  12379. The result of drag and drop can change depending on what the source object is 
  12380. and what the target object is.  For example, if the user drags a file object 
  12381. from one folder object and drops it on another, the file is moved to the target 
  12382. folder.  However, if the user drops the same file onto a printer, the operating 
  12383. system makes a copy of the file and puts the copy into the printer's queue to 
  12384. be printed.  The original file is returned to its original location. 
  12385.  
  12386.  
  12387. ΓòÉΓòÉΓòÉ 8.1.6. Designing an Object-Oriented User Interface ΓòÉΓòÉΓòÉ
  12388.  
  12389. The following items are key in designing an object-oriented user interface: 
  12390.  
  12391. o Objects and their relationships 
  12392. o Visual representations of objects 
  12393. o Interaction Techniques and Mechanisms. 
  12394.  
  12395. Objects and their relationships can be defined by answering the following 
  12396. questions: 
  12397.  
  12398. o What objects does the user require? 
  12399. o How are the objects related? 
  12400. o What properties and behaviors should the objects have? 
  12401.  
  12402. To illustrate their importance, consider the example of the design of a 
  12403. software model of a car dealership.  A salesperson needs a car object to 
  12404. represent each car model on his lot.  He also needs a customer object to 
  12405. represent each customer that purchases a car.  He needs a worksheet object to 
  12406. track sales, profits, inventory, customers, and so on.  Finally, he needs 
  12407. container objects to group these objects. 
  12408.  
  12409. The visual representations of objects must ensure consistency with one another 
  12410. and with the operating system.  Visual representations of objects should 
  12411. address the functional aspects of visual representations, such as usability and 
  12412. purpose:  Does the visual convey the purpose of the object being represented? 
  12413. Visual representations also should address the aesthetic aspects, such as 
  12414. shape, size, and color:  Is the representation visually pleasing? 
  12415.  
  12416. Users should interact with similar objects in similar ways and in ways that 
  12417. seem natural.  Users also should have a choice of interaction mechanisms that 
  12418. suits their tasks, level of skill, and preferred style of interaction.  In the 
  12419. car dealership example, a salesperson must be able to place information into a 
  12420. worksheet object in any of several ways.  The salesperson can place a car 
  12421. object on top of the worksheet object, thereby transferring information about 
  12422. the car to the worksheet;  or the salesperson can type information directly 
  12423. into the worksheet object;  or the salesperson can select portions of 
  12424. information from the car object and copy them to the worksheet object. 
  12425.  
  12426.  
  12427. ΓòÉΓòÉΓòÉ 8.1.6.1. Defining the Objects for a Software Model ΓòÉΓòÉΓòÉ
  12428.  
  12429. To design a software model that serves the needs of the users, the above is 
  12430. translated into: 
  12431.  
  12432. o Who are the users? 
  12433. o What tasks do they perform? 
  12434.  
  12435. In the car dealership example, the salesperson is the user.  The user's tasks 
  12436. can include: 
  12437.  
  12438. o Determining what a customer wants, needs, and can afford 
  12439. o Determining what cars are in stock that match the customer's wants, needs, 
  12440.   and budget 
  12441. o Negotiating an agreement using a worksheet 
  12442. o Getting approval from the sales manager 
  12443. o Giving the worksheet information to the finance manager. 
  12444.  
  12445. From this analysis, the objects that should be part of our software model can 
  12446. be identified.  These include a car object, car lot object, customer object, 
  12447. customer list object, worksheet object, worksheet list object, salesperson 
  12448. object, sales manager object, and finance manager object. 
  12449.  
  12450. To simplify this explanation, consider the car object only.  Each car object 
  12451. represents a real car for sale in the car lot.  A car object contains 
  12452. descriptive information about the corresponding real car, such as its year, 
  12453. make, model, price, factory-installed options, color, and vehicle 
  12454. identification number.  Because the primary purpose of a car object is to 
  12455. convey information, the car object is a data object. 
  12456.  
  12457.  
  12458. ΓòÉΓòÉΓòÉ 8.1.6.2. Determining Object Relationships and Behaviors ΓòÉΓòÉΓòÉ
  12459.  
  12460. The next step in the design of a software model is to determine how each object 
  12461. interacts with other objects.  In the car dealership, information contained in 
  12462. car objects must be transferable to a worksheet object.  The user should have 
  12463. the option to drag a car object and drop it onto a worksheet object.  The user 
  12464. also should have the option to choose an action to copy the information from a 
  12465. car object to a worksheet object. 
  12466.  
  12467.  
  12468. ΓòÉΓòÉΓòÉ 8.1.6.3. Determining the Necessary Views ΓòÉΓòÉΓòÉ
  12469.  
  12470. After identifying and defining the objects, consider what views of the car 
  12471. object will give the user (salesperson) the best access to the objects and the 
  12472. information they contain.  Car information consists of a combination of text 
  12473. (model, year, and so forth) and graphic information (a picture of a car) that 
  12474. make up a single, General Information view. 
  12475.  
  12476.  
  12477. ΓòÉΓòÉΓòÉ 8.1.6.4. Determining the Action Choices ΓòÉΓòÉΓòÉ
  12478.  
  12479. From a salesperson's perspective, most of the information about a car object is 
  12480. fixed-that is, the information is based on a real-world object and cannot be 
  12481. changed unless something changes about the real-world object.  For example, it 
  12482. would not make sense to permit a salesperson to change the color of a car 
  12483. object to correspond to the color of the actual car he is trying to sell. 
  12484. Because a salesperson can change little about a car object, the car object has 
  12485. only a few action choices: 
  12486.  
  12487. o Open as general information 
  12488. o Print 
  12489. o Edit 
  12490. o Copy to clipboard 
  12491. o Find 
  12492. o Windows. 
  12493.  
  12494.  
  12495. ΓòÉΓòÉΓòÉ 8.2. The OS/2 Object-Oriented User Interface: The Workplace Shell ΓòÉΓòÉΓòÉ
  12496.  
  12497. In OS/2 1.X, the Desktop is a collection of windows or icons representing 
  12498. windows associated with applications.  In OS/2 2.0, the Desktop is a collection 
  12499. of objects (icons) and windows associated with those objects.  The Desktop 
  12500. (which also is an object), the objects that appear on the Desktop, and the 
  12501. underlying code supporting these objects constitute the OS/2 Workplace Shell, 
  12502. the default user interface for OS/2 2.0. 
  12503.  
  12504. The OS/2 Workplace Shell provides an object-oriented user environment that is 
  12505. based on the 1991 CUA guidelines.  It provides a seamless environment, where 
  12506. all services are task-oriented and the user is shielded from the complexities 
  12507. of the operating system.  The user can perform tasks faster and easier and with 
  12508. a shorter learning curve. 
  12509.  
  12510. In the OS/2 Workplace, the Shell applications from OS/2 1.X are replaced by 
  12511. objects and collections of objects, or folders Users do not have to be aware of 
  12512. where an object is (which drive or network) or what it is called.  They can 
  12513. place an object wherever they wish and call it by any name.  They do not have 
  12514. to know about EXEs, DLLs, device drivers, or how to add a printer or use a 
  12515. network.  If they want to print a report on the laser printer down the hall, 
  12516. they can simply drag the icon representing the report and drop it onto the icon 
  12517. representing the laser printer that is labeled "Laser printer down the hall". 
  12518.  
  12519. Users act on all objects in a consistent manner.  They can act on program files 
  12520. the same as program references.  There is no difference in using programs on a 
  12521. network server or on a hard disk or on a CD drive.  There is no difference in 
  12522. setting up or printing to a local or remote printer. 
  12523.  
  12524. In the OS/2 Workplace, users are not aware of the file system. They need not 
  12525. know anything about disk drives or directories.  They need know only about 
  12526. folders and the objects they put into them.  They can put applications, files, 
  12527. and so forth, in a folder, as shown in the following figure. They can arrange 
  12528. things, regardless of where they physically reside, to suit themselves and 
  12529. their own needs.  And they can label the folders by any name. 
  12530.  
  12531.      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12532.      Γöé      My NewsLetter Composition Folder     Γöé
  12533.      Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12534.      Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ            ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ            Γöé
  12535.      Γöé       Γöé    Γöé            Γöé    Γöé            Γöé
  12536.      Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ            ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ            Γöé
  12537.      Γöé    My Text Editor  My Graphics Editor     Γöé
  12538.      Γöé                                           Γöé
  12539.      Γöé                                           Γöé
  12540.      Γöé         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ             ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ         Γöé       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÉ
  12541.      Γöé         Γöé    Γöé             Γöé    Γöé         Γöé       Γöé    Γöé
  12542.      Γöé         ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ             ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ         Γöé       ΓööΓöÇΓöÇΓöÇΓöÇΓöÿ
  12543.      Γöé    My Layout Program    My Final Copy     Γöé     My Printer
  12544.      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12545.  
  12546. Objects in a Folder 
  12547.  
  12548. the following table. Some of the objects the OS/2 Workplace provides are 
  12549. described in After installation of OS/2 2.0, some of the objects appear 
  12550. directly on the Desktop.  Some of them are contained in folders. Users can 
  12551. rearrange and re-label objects to suit themselves. 
  12552.  
  12553. Some Workplace Objects Provided by OS/2 2.0 
  12554.  
  12555. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12556. ΓöéObject              ΓöéDescription                             Γöé
  12557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12558. ΓöéClock               ΓöéSets and views the current date, time,  Γöé
  12559. Γöé                    Γöéand alarm.                              Γöé
  12560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12561. ΓöéCountry             ΓöéSets and views international conventionsΓöé
  12562. Γöé                    Γöéfor system elements (country, date,     Γöé
  12563. Γöé                    Γöétime, numbers).                         Γöé
  12564. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12565. ΓöéKeyboard            ΓöéSets and views keyboard configuration   Γöé
  12566. Γöé                    Γöé(timing, mappings, special needs).      Γöé
  12567. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12568. ΓöéMouse               ΓöéSets and views behavior of mouse device Γöé
  12569. Γöé                    Γöé(timing, setup, button mappings).       Γöé
  12570. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12571. ΓöéScheme palette      ΓöéSets and views window color and font    Γöé
  12572. Γöé                    Γöéattributes.                             Γöé
  12573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12574. ΓöéFont palette        ΓöéSets and views fonts for textual        Γöé
  12575. Γöé                    Γöéelements of user interface and apply    Γöé
  12576. Γöé                    Γöéfonts to windows.                       Γöé
  12577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12578. ΓöéColor palette       ΓöéSets and views colors for visual        Γöé
  12579. Γöé                    Γöéelements of user interface and applies  Γöé
  12580. Γöé                    Γöécolor to a window.                      Γöé
  12581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12582. ΓöéPrinter             ΓöéSets and views a print destination (a   Γöé
  12583. Γöé                    Γöéprint queue and its associated port).   Γöé
  12584. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12585. ΓöéShredder            ΓöéDestroys an object.                     Γöé
  12586. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12587. ΓöéSound               ΓöéEnables/disables warning beep.          Γöé
  12588. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12589. ΓöéSpecial needs       ΓöéExplains implications of special needs  Γöé
  12590. Γöé                    Γöémode when activated.                    Γöé
  12591. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12592. ΓöéSpooler             ΓöéEnables/disables spooling.  Sets and    Γöé
  12593. Γöé                    Γöéviews spool path.                       Γöé
  12594. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12595. ΓöéSystem              ΓöéSets and views behavior of system       Γöé
  12596. Γöé                    Γöéelements (confirmations, logo, windows).Γöé
  12597. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12598.  
  12599.  
  12600. ΓòÉΓòÉΓòÉ 8.3. The OS/2 2.0 Workplace Programming Interface ΓòÉΓòÉΓòÉ
  12601.  
  12602. While object-oriented user interfaces share some concepts with object-oriented 
  12603. programming, user objects might not necessarily correspond to software objects. 
  12604. Object-oriented programming can make the development of an object-oriented user 
  12605. interface easier.  However, an object-oriented user interface can be developed 
  12606. with more traditional programming languages and tools. 
  12607.  
  12608. The OS/2 2.0 Workplace is an example of a user interface developed using 
  12609. object-oriented programming, specifically, the IBM System Object Model. In 
  12610. fact, every user object in the OS/2 2.0 Workplace is an instance of a Workplace 
  12611. software class object.  There is a 1:1 correspondence between Workplace (user) 
  12612. objects and Workplace (software) classes.  This is evident in the class 
  12613. hierarchy for Workplace objects, as shown in the following figure. 
  12614.  
  12615. SOMObject
  12616.   Γö£ΓöÇΓöÇ  SOMClass
  12617.   Γö£ΓöÇΓöÇ  SOMClassMgr
  12618.   ΓööΓöÇΓöÇ  WPObject
  12619.          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  12620.          ΓööΓöÇ WPAbstract           ΓööΓöÇ WPFileSystem           ΓööΓöÇ WPTransient
  12621.               Γö£ΓöÇΓöÇ  WPClock               Γö£ WPDataFile           Γö£ΓöÇΓöÇ  WPJob
  12622.               Γö£ΓöÇΓöÇ  WPCountry             Γöé                      Γö£ΓöÇΓöÇ  WPPort
  12623.               Γö£ΓöÇΓöÇ  WPDisk                Γö£ WPFolder             Γö£ΓöÇΓöÇ  WPPrinterDriver
  12624.               Γö£ΓöÇΓöÇ  WPKeyboard            Γöé    Γö£ΓöÇΓöÇ WPDesktop     ΓööΓöÇΓöÇ  WPQueueDriver
  12625.               Γö£ΓöÇΓöÇ  WPMouse               Γöé    Γö£ΓöÇΓöÇ WPDrives
  12626.               Γö£ΓöÇΓöÇ  WPPalette             Γöé    Γö£ΓöÇΓöÇ WPStartup
  12627.               Γöé      Γö£ΓöÇΓöÇ  WPColorPalette Γöé    ΓööΓöÇΓöÇ WPTemplateFolder
  12628.               Γöé      Γö£ΓöÇΓöÇ  WPFontPalette  Γöé
  12629.               Γöé      ΓööΓöÇΓöÇ  WPSchemePaletteΓöö WPProgramFile
  12630.               Γö£ΓöÇΓöÇ  WPProgram
  12631.               Γö£ΓöÇΓöÇ  WPShadow
  12632.               Γö£ΓöÇΓöÇ  WPShredder
  12633.               Γö£ΓöÇΓöÇ  WPSound
  12634.               Γö£ΓöÇΓöÇ  WPSpecialNeeds
  12635.               Γö£ΓöÇΓöÇ  WPSpooler
  12636.               ΓööΓöÇΓöÇ  WPSystem
  12637.  
  12638. Workplace Object Class Hierarchy 
  12639.  
  12640. All OS/2 2.0 Workplace classes are derived from a root Workplace class, 
  12641. WPObject, which is derived from the root SOM class, SOMObject.  Workplace 
  12642. classes are defined using SOM's Object Interface Definition Language (OIDL). 
  12643. Workplace class libraries are built using the SOM compiler.  Workplace objects 
  12644. are instantiated by the Workplace on behalf of the user through the Workplace 
  12645. Class List Object, installation programs, or batch files.  The same rules that 
  12646. apply to SOM classes apply to Workplace classes, with the exception that 
  12647. applications cannot call Workplace methods. (SOM client applications can call 
  12648. SOM methods.) 
  12649.  
  12650. Some Workplace classes (WPObject, WPAbstract, WPFileSystem, WPTransient) cannot 
  12651. be instantiated.  These classes are provided as base classes which define 
  12652. common characteristics and behavior for descendant classes. Object 
  12653. characteristics and behavior are defined as methods for the object's class, as 
  12654. well as methods inherited from ancestor classes. 
  12655.  
  12656. WPObject is the root class for all Workplace classes:  it defines behavior 
  12657. common to all Workplace objects.  The immediate descendants of WPObject are 
  12658. storage classes, from which all other Workplace classes are derived.  Storage 
  12659. classes define methods for storing and retrieving data associated with 
  12660. instances of descendant classes.  Storage classes provided with the OS/2 2.0 
  12661. Workplace are shown in the following table. 
  12662.  
  12663. Workplace Storage Classes 
  12664.  
  12665. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12666. ΓöéClass               ΓöéStorage of Object Instance Data         Γöé
  12667. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12668. ΓöéWPAbstract          ΓöéObject instance data stored in user     Γöé
  12669. Γöé                    Γöéprofile (OS2.INI).                      Γöé
  12670. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12671. ΓöéWPFileSystem        ΓöéObject instance data stored in files in Γöé
  12672. Γöé                    Γöéthe file system.                        Γöé
  12673. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12674. ΓöéWPTransient         ΓöéObject instance data not saved.         Γöé
  12675. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12676.  
  12677. Objects whose instance data and state is preserved between system shutdown and 
  12678. system startup are called persistent objects. Objects whose instance data and 
  12679. state need not be preserved between system shutdown and system startup are 
  12680. called nonpersistent objects. 
  12681.  
  12682.  
  12683. ΓòÉΓòÉΓòÉ 8.3.1. Designing Workplace Classes ΓòÉΓòÉΓòÉ
  12684.  
  12685. To design a Workplace class, first identify all the actions to which an object 
  12686. instance can respond.  Based on this list, define the methods in the class 
  12687. definition file that correspond to the actions that were identified.  To 
  12688. illustrate this process and understand how method requirements for a class are 
  12689. identified, consider the WPObject and WPAbstract classes. 
  12690.  
  12691. Based on the general description of user objects in a CUA-conforming user 
  12692. environment, objects have the following: 
  12693.  
  12694. o Properties (for example, an icon representation in the Workplace) 
  12695. o Views that contain information about the object 
  12696. o Context, or pop-up, menus that describe actions to which the object can 
  12697.   respond 
  12698. o Mobility (They can be directly manipulated.) 
  12699.  
  12700. These characteristics and behaviors should be reflected in the methods in the 
  12701. class definition file for the WPObject class. The following table shows the 
  12702. mapping of characteristics and behaviors common to all Workplace objects to 
  12703. method groups defined for this class. 
  12704.  
  12705. Defining Methods for the WPObject Class 
  12706.  
  12707. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12708. ΓöéMethod Group                  ΓöéCharacteristic/Behavior       Γöé
  12709. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12710. ΓöéSettings Notebook methods     ΓöéProperties                    Γöé
  12711. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12712. ΓöéSave/restore state methods    ΓöéPersistence of object instanceΓöé
  12713. Γöé                              Γöédata                          Γöé
  12714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12715. ΓöéObject usage methods          ΓöéObject usage information      Γöé
  12716. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12717. ΓöéPop-up menu methods           ΓöéActions that users can performΓöé
  12718. Γöé                              Γöéon objects                    Γöé
  12719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12720. ΓöéSet/query object information  ΓöéObject information (views,    Γöé
  12721. Γöémethods                       Γöéstyle, title)                 Γöé
  12722. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12723. ΓöéError handling methods        ΓöéError returns                 Γöé
  12724. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12725. ΓöéMemory management methods     ΓöéMemory allocation             Γöé
  12726. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12727. ΓöéSet/cleanup methods           ΓöéInitialization and terminationΓöé
  12728. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12729. ΓöéDirect manipulation methods   ΓöéMobility                      Γöé
  12730. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12731.  
  12732. In the above table, there are method groups in the WPObject class definition 
  12733. that support general object characteristics and behaviors that are included in 
  12734. the list above.  There also are method groups in the WPObject class definition 
  12735. that support object characteristics and behaviors that are not included in the 
  12736. list. 
  12737.  
  12738.  
  12739. ΓòÉΓòÉΓòÉ 8.3.1.1. Settings Notebook Methods ΓòÉΓòÉΓòÉ
  12740.  
  12741. The WPObject class provides for a standard page in a Workplace object's 
  12742. Settings Notebook:  a General page.  This page describes all the general object 
  12743. properties (title, icon, and a user-definable setting to specify whether or not 
  12744. this object is a template).  All Workplace objects have general properties 
  12745. associated with them;  therefore, all Workplace objects have a General page in 
  12746. their Settings Notebook.  Settings Notebook pages for Workplace objects are 
  12747. inherited from the ancestors of the Workplace class.  This means that they 
  12748. include pages that have been added or removed by ancestor classes, in addition 
  12749. to the General page inherited from the root WPObject class. 
  12750.  
  12751. For example, suppose that MyObject is a persistent object derived from the 
  12752. WPAbstract class.  Because WPAbstract is derived from the WPObject class, 
  12753. MyObject inherits characteristics and behaviors from WPAbstract and WPObject. 
  12754. WPAbstract inherits its Settings Notebook from WPObject. MyObject, therefore, 
  12755. also inherits WPObject's Settings Notebook. WPObject defines a General page in 
  12756. the Settings Notebook for all classes of objects.  Also, suppose that MyObject 
  12757. class defines two additional pages in its Settings Notebook:  MyPage_1 and 
  12758. MyPage_2. That is, the Settings Notebook for the MyObject class has three 
  12759. pages:  General, MyPage_1 and MyPage_2.  Now suppose that YourObject class is 
  12760. derived from MyObject class and, therefore, by inheritance, defines a General 
  12761. page, as well as MyPage_1 and MyPage_2 in its Settings Notebook.  Also suppose 
  12762. that YourObject class defines an additional page in its Settings Notebook: 
  12763. YourPage.  The Settings Notebook for YourObject Class has four pages:  General 
  12764. (inherited from the WPObject class), MyPage_1, MyPage_2 (inherited from 
  12765. MyObject class), and YourPage. The pages in the Settings Notebooks for MyObject 
  12766. and YourObject are shown in the following figure. 
  12767.  
  12768.  
  12769. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12770. Γöé   MyObject Settings   Γöé                 Γöé  YourObject Settings  Γöé
  12771. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                 Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12772. Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12773. Γöé                       Γöé   General  Γöé    Γöé                       Γöé   General  Γöé
  12774. Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12775. Γöé  This page is not     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé  This page is not     Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12776. Γöé  inherited from           MyPage_1 Γöé    Γöé  inherited from       Γöé   MyPage_1 Γöé
  12777. Γöé  MyObject's ancestors.ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé  YourObject's         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12778. Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé  ancestors.           Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12779. Γöé                       Γöé   MyPage_2 Γöé    Γöé                       Γöé   MyPage_2 Γöé
  12780. Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé                       Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12781. Γöé                       Γöé                 Γöé                       ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12782. Γöé                       Γöé                 Γöé                           YourPage Γöé
  12783. Γöé                       Γöé                 Γöé                       ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12784. Γöé                       Γöé                 Γöé                       Γöé
  12785. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12786.  
  12787. Adding Pages to an Object's Settings Notebook 
  12788.  
  12789. The Settings Notebook methods, as shown in the following table, enable you to 
  12790. add new pages or remove pages that a class has inherited from its ancestor's 
  12791. Settings Notebook. 
  12792.  
  12793. Settings Notebook Methods 
  12794.  
  12795. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12796. ΓöéMethod                        ΓöéDescription                   Γöé
  12797. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12798. ΓöéwpAddObjectGeneralPage        ΓöéAdds the General page to the  Γöé
  12799. Γöé                              Γöéobject's Settings Notebook.   Γöé
  12800. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12801. ΓöéwpAddSettingsPages            ΓöéAdds pages to the object's    Γöé
  12802. Γöé                              ΓöéSettings Notebook.            Γöé
  12803. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12804. ΓöéwpInsertSettingsPage          ΓöéInserts a page into the       Γöé
  12805. Γöé                              Γöéobject's Settings Notebook.   Γöé
  12806. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12807.  
  12808. An object's Settings Notebook is built by the Shell by calling the object's 
  12809. wpAddSettingsPages method.  To add pages to the Settings Notebook that a class 
  12810. inherits from its ancestors, override this method. 
  12811.  
  12812. Adding pages a class has inherited from its ancestors to the Settings Notebook 
  12813. is accomplished by overriding the wpAddSettingsPages method and calling a new 
  12814. method that inserts the new page.  The new method calls the 
  12815. wpInsertSettingsPage method to insert the new page into the object's notebook. 
  12816. This technique is shown in the following figure. 
  12817.  
  12818.   /*********************    New Methods     ***************************/
  12819.   SOM_Scope ULONG SOMLINK MyObject_wpAddAnotherPage(MyObject *somSelf,
  12820.                   HWND hwndNotebook)
  12821.   {
  12822.   PAGEINFO pageinfo;
  12823.   .
  12824.   /* Set up page information data structure for my new page.          */
  12825.   .
  12826.   /* Add the page to the Settings Notebook                            */
  12827.   return _wpInsertSettingsPage(somSelf, hwndNotebook, &pageinfo);
  12828.   }
  12829.  
  12830.  
  12831.   /*********************  Method Overrides  ***************************/
  12832.  
  12833.   SOM_Scope BOOL32 SOMLINK MyObject_wpAddSettingsPage (MyObject *somSelf,
  12834.                   HWND hwndNotebook)
  12835.   {
  12836.   .
  12837.   .
  12838.   if (parent_wpAddSettingsPage (somSelf, hwndNotebook)
  12839.      && _wpAddAnotherPage (somSelf, hwndNotebook))
  12840.      return (TRUE);        /*pages added successfully       */
  12841.   else
  12842.      return (FALSE);       /*something failed -return error */
  12843.   }
  12844.  
  12845. Adding Pages to an Object's Settings Notebook 
  12846.  
  12847. New pages for an object's Settings Notebook can be placed at the top or bottom 
  12848. of pages inherited from the object's ancestor classes.  By calling the 
  12849. parent_wpAddSettingsPage method before calling the new wpAddAnotherPage method, 
  12850. the new page is added to the top of the Settings Notebook, above pages 
  12851. inherited from ancestor classes.  If the sequence is reversed, the new page is 
  12852. added to the bottom of the Settings Notebook, below pages inherited from 
  12853. ancestor classes. 
  12854.  
  12855. A page can be removed from an object's Settings Notebook by overriding the 
  12856. ancestor's method that inserts it.  From the previous example, the Settings 
  12857. Notebook for YourObject class inherits the pages (General, MyPage_1, and 
  12858. MyPage_2) defined by its ancestors (MyObject and WPObject).  But YourObject 
  12859. class may have requirements for MyPage_1, but not MyPage_2.  To remove MyPage_2 
  12860. from YourObject's Settings Notebook,  YourObject must override the method 
  12861. inherited from MyObject that adds MyPage_2 to the Settings Notebook and return 
  12862. SETTINGS_PAGE_REMOVED without calling the parent method.  This is illustrated 
  12863. in the following figure. 
  12864.  
  12865.   /********************* Method Overrides   ***************************/
  12866.   SOM_Scope ULONG SOMLINK YourObject_wpAddAnotherPage(YourObject *somSelf,
  12867.                   HWND hwndNotebook)
  12868.   {
  12869.   .
  12870.   .
  12871.   /* Remove this page from the Settings notebook.                     */
  12872.   return (SETTINGS_PAGE_REMOVED);
  12873.   }
  12874.  
  12875. Removing a Page from an Object's Settings Notebook 
  12876.  
  12877. The same technique can be used to replace or remove the General page from an 
  12878. object's Settings Notebook by overriding both the wpAddSettingsPages and 
  12879. wpAddObjectGeneralPage methods. The override to wpAddSettingsPages calls the 
  12880. wpAddObjectGeneralPage method.  To remove the General page, the override to 
  12881. wpAddObjectGeneralPage returns SETTINGS_PAGE_REMOVED without calling the parent 
  12882. method.  To replace the General page with another page, the override to 
  12883. wpAddObjectGeneralPage calls wpInsertSettingsPage without calling the parent 
  12884. method. 
  12885.  
  12886.  
  12887. ΓòÉΓòÉΓòÉ 8.3.1.2. Pop-Up Menus ΓòÉΓòÉΓòÉ
  12888.  
  12889. Pop-up menu methods support the actions that the user can perform on an object. 
  12890. These actions appear in a context or pop-up menu when the user presses button 2 
  12891. of the pointing device.  A pop-up menu contains action choices for an object in 
  12892. its current context or state.  The contents of a pop-up menu depends on the 
  12893. state of the object. 
  12894.  
  12895. Pop-up menus consist of a set of selectable items and any pull-down or 
  12896. conditional cascade menus associated with them.  In the following figure, Open, 
  12897. Help and Print are items in the object's primary pop-up menu.  Settings and 
  12898. Details are items in the Open pull-down or conditional cascade menu. 
  12899. Conditional cascade menus have mini-push buttons displayed next to the pop-up 
  12900. menu item. If the user selects the pop-up menu item, a default action listed in 
  12901. the pull-down menu is performed. If the user selects the mini-push button, the 
  12902. pull-down menu is displayed. It is a conditional cascade menu because it is 
  12903. displayed only if the user selects the mini-push button. 
  12904.  
  12905.                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12906.                    Γöé Open   (->) Γöé x Settings  Γöé
  12907.                    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12908.                    Γöé Help        Γöé  Details    Γöé
  12909.                    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12910.                    Γöé Print  (->) Γöé
  12911.                    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12912.  
  12913. Pop-Up and Conditional Cascade Menus 
  12914.  
  12915. Like Settings Notebook pages, pop-up menus are inherited from a class's 
  12916. ancestor classes.  This means that they include pop-up menu items that ancestor 
  12917. classes have added to or removed from the pop-up menu inherited from WPObject. 
  12918. The pop-up methods, as shown in the following table, permit you to add new menu 
  12919. items to or remove menu items from the pop-up menu inherited from an object's 
  12920. ancestor classes. 
  12921.  
  12922. Pop-Up Menu Methods to Modify an Object's Pop-up Menu 
  12923.  
  12924. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12925. ΓöéMethod                  ΓöéDescription                         Γöé
  12926. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12927. ΓöéwpFilterPopupMenu       ΓöéFilters out options from object's   Γöé
  12928. Γöé                        Γöépop-up menu that don't apply.       Γöé
  12929. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12930. ΓöéwpInsertPopupMenuItems  ΓöéInserts items into object's pop-up  Γöé
  12931. Γöé                        Γöémenu.                               Γöé
  12932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12933. ΓöéwpModifyPopupMenu       ΓöéAdds new options to the object's    Γöé
  12934. Γöé                        Γöépop-up menu.                        Γöé
  12935. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12936.  
  12937. When a user requests an object's pop-up menu, the Shell builds the object's 
  12938. pop-up menu by calling the object's wpFilterPopupMenu and wpModifyPopupMenu 
  12939. methods.  The wpInsertPopupMenuItems method is called by an override to the 
  12940. wpModifyPopupMenu method to add new options to an object's pop-up menu. 
  12941.  
  12942.  
  12943. ΓòÉΓòÉΓòÉ 8.3.1.2.1. Adding and Removing Items from a Pop-Up Menu ΓòÉΓòÉΓòÉ
  12944.  
  12945. The WPObject class defines a set of standard pop-up menu items that are 
  12946. inherited by all Workplace objects.  The pop-up menu of a Workplace object 
  12947. consists of a subset of the standard pop-up menu items and any new menu items 
  12948. defined for the object's class or inherited from other ancestors. 
  12949.  
  12950. Workplace classes can add or delete standard pop-up menu items from their 
  12951. pop-up menu by overriding the wpFilterPopupMenu method.  Each standard pop-up 
  12952. menu item is associated with a flag defined by the WPObject class, as shown in 
  12953. the following table. 
  12954.  
  12955. Flags for Standard Pop-Up Menu Items Inherited from WPObject 
  12956.  
  12957. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12958. ΓöéMenu Item Flag                ΓöéDescription                   Γöé
  12959. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12960. ΓöéCTXT_CREATEANOTHER            ΓöéCreate another                Γöé
  12961. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12962. ΓöéCTXT_OPEN                     ΓöéOpen                          Γöé
  12963. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12964. ΓöéCTXT_CLOSE                    ΓöéClose                         Γöé
  12965. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12966. ΓöéCTXT_SETTINGS                 ΓöéOpen settings                 Γöé
  12967. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12968. ΓöéCTXT_PRINT                    ΓöéPrint                         Γöé
  12969. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12970. ΓöéCTXT_HELP                     ΓöéHelp                          Γöé
  12971. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12972. ΓöéCTXT_DELETE                   ΓöéDelete                        Γöé
  12973. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12974. ΓöéCTXT_COPY                     ΓöéCopy                          Γöé
  12975. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12976. ΓöéCTXT_MOVE                     ΓöéMove                          Γöé
  12977. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12978. ΓöéCTXT_SHADOW                   ΓöéCreate shadow                 Γöé
  12979. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12980. ΓöéCTXT_WINDOW                   ΓöéWindow                        Γöé
  12981. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12982.  
  12983. The wpFilterPopupMenu method returns the flags that represent the pop-up menu 
  12984. items for the object.  In removing a standard pop-up menu item from the pop-up 
  12985. menu, the override to wpFilterPopupMenu masks the flag that corresponds to the 
  12986. item being removed from the flags that represent the standard pop-up menu items 
  12987. inherited from the object's parent. For example, suppose that printing MyObject 
  12988. has no meaning.  To remove the Print option from MyObject's pop-up menu, 
  12989. wpFilterPopupMenu is overridden as shown in the following figure. 
  12990.  
  12991.   /*                     Method Override                         */
  12992.  
  12993.   /*   Filter out any options from the pop-up that don't apply. */
  12994.  
  12995.   SOM_Scope ULONG   SOMLINK MyObject_wpFilterPopupMenu(MyObject *somSelf,
  12996.                             ULONG ulFlags, HWND hwndCnr, BOOL32 fMultiSelect)
  12997.   {
  12998.   MyObjectData *somThis = MyObjectGetData(somSelf);
  12999.   MyObjectMethodDebug("MyObject","MyObject_wpFilterPopupMenu");
  13000.  
  13001.   /* Don't allow anyone to print MyObject                        */
  13002.  
  13003.   return( parent_wpFilterPopupMenu(somSelf,ulFlags,hwndCnr,fMultiSelect)
  13004.                               & ~CTXT_PRINT );
  13005. }
  13006.  
  13007. Removing Standard Items from an Object's Pop-Up Menu 
  13008.  
  13009. In the following figure, flags that represent the standard pop-up menu items of 
  13010. MyObject's parent class are returned from the call to parent_wpFilterPopupMenu. 
  13011. To remove the Print option from MyObject's pop-up menu, these flags are AND'd 
  13012. with the complement of CTXT_PRINT.  Conversely, if the pop-up menu of 
  13013. MyObject's parent class did not include the Print option, the Print option can 
  13014. be added to MyObject's pop-up menu by OR'ing these flags with CTXT_PRINT. 
  13015.  
  13016. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13017. Γöé Usage Note:  An object's pop-up menu is inherited from its Γöé
  13018. Γöéancestors.  To ensure that calls to the wpFilterPopupMenu   Γöé
  13019. Γöémethod belonging to the object's ancestors do not add the   Γöé
  13020. Γöémenu item after it is deleted or remove the menu item after Γöé
  13021. Γöéit is added, the parent_wpFilterPopupMenu method is called  Γöé
  13022. Γöéfirst.                                                      Γöé
  13023. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13024.  
  13025. Other Workplace classes provided with the Shell define standard pop-up menu 
  13026. items for their descendants. The following figure lists the flags associated 
  13027. with these additional standard pop-up menu items. 
  13028.  
  13029.    WPFolder             WPDesktop             WPProgram             WPPalette
  13030.  
  13031.  
  13032.    CTXT_ICON            TXT_SHUTDOWN          CTXT_PROGRAM          CTXT_PALETTE
  13033.    CTXT_TREE            CTXT_LOCKUP
  13034.    CTXT_DETAILS
  13035.    CTXT_FIND
  13036.    CTXT_SELECT
  13037.    CTXT_ARRANGE
  13038.    CTXT_SORT
  13039.  
  13040. Flags for Standard Pop-Up Menu Items Defined by Other Workplace Classes 
  13041.  
  13042. These items are added by the respective classes using the wpModifyPopupMenu 
  13043. method.  Any override to wpModifyPopupMenu must call the parent method so that 
  13044. these items are added to the pop-up menu inherited from ancestor classes. 
  13045.  
  13046.  
  13047. ΓòÉΓòÉΓòÉ 8.3.1.2.2. Adding Class-Specific Items to the Primary Pop-Up Menu ΓòÉΓòÉΓòÉ
  13048.  
  13049. New items are added to the pop-up menu inherited from an object's ancestors by 
  13050. overriding the object's wpModifyPopupMenu method and calling the 
  13051. wpInsertPopupMenuItems method.  The object's class also defines a new 
  13052. FilterPopupMenu method that returns flags representing the new items added to 
  13053. the object's pop-up menu. 
  13054.  
  13055. For example, to add New Item to MyObject's pop-up menu, the new menu item is 
  13056. defined in a resource file in the same manner as menus are defined in PM 
  13057. programs.  An ID is assigned to the new menu and to the menu item, as shown in 
  13058. the following figure. 
  13059.  
  13060.   #define ID_MOREITEMS   WPMENUID_USER+1
  13061.   #define ID_NEWITEMS    WPMENUID_USER+2
  13062.  
  13063.  
  13064.   MENU ID_MOREITEMS LOADONCALL MOVEABLE DISCARDABLE
  13065.   BEGIN
  13066.     MENUITEM "New Item", ID_NEWITEMS
  13067.   END
  13068.  
  13069. Resource File Defining New Items for Object's Pop-Up Menu 
  13070.  
  13071. IDs for class-specific menus and menu items have a value greater than 
  13072. WPMENUID_USER so they do not conflict with IDs for menus and menu items defined 
  13073. by the Workplace classes provided with the Shell. IDs for standard items in an 
  13074. object's pop-up menu are shown in the following figure. 
  13075.  
  13076.       WPObject         WPFolder
  13077.  
  13078.       WPMENUID_OPEN    WPMENUID_SELECT
  13079.       WPMENUID_HELP    WPMENUID_SORT
  13080.       WPMENUID_PRINT
  13081.  
  13082. IDs for Standard Items in a Pop-Up Menu 
  13083.  
  13084. A new method for MyObject class, wpMyFilterPopupMenu, returns flags (in this 
  13085. case, a flag) that represent the new items added to the inherited pop-up menu 
  13086. for the MyObject class.  The override to wpModifyPopupMenu uses the flags 
  13087. returned from wpMyFilterPopupMenu to determine which items are inserted in 
  13088. MyObject's pop-up menu. This is illustrated in the following figure. 
  13089.  
  13090.   /* Define MYCTXT_NEWITEM here                                  */
  13091.  
  13092.  
  13093.   /*                      New Method                             */
  13094.   /*   Filter new items added to MyObject's pop-up menu          */
  13095.   SOM_Scope ULONG  SOMLINK MyObject_wpMyFilterPopupMenu(MyObject *somSelf,
  13096.                          ULONG ulFlags, HWND hwndCnr, BOOL32 fMultiSelect)
  13097.   {
  13098.   .
  13099.   .
  13100.   return(MYCTXT_NEWITEM);
  13101.   }
  13102.  
  13103.  
  13104.   /*                     Method Override                         */
  13105.   /*    Add a new item to MyObject's pop-up menu                 */
  13106.  
  13107.   SOM_Scope BOOL32   SOMLINK MyObject_wpModifyPopupMenu(MyObject *somSelf,
  13108.                              HWND hwndMenu, HWND hwndCnr, ULONG ulPosition)
  13109.   {
  13110.   .
  13111.   /* Get flags for new items for MyObject's pop-up menu          */
  13112.   flags=_wpMyFilterPopupMenu(...);
  13113.  
  13114.   /* Insert new items in MyObject's Primary Menu if flag is set  */
  13115.   if (flags & MYCTXT_NEWITEM)
  13116.      _wpInsertPopupMenuItemsA(somSelf, hwndMenu, ulPosition, hmod,
  13117.                              ID_MOREITEMS, WPMENUID_PRIMARY);
  13118.  
  13119.   /* Add the items inherited from MyObject's parent      */
  13120.   return (parent_wpModifyPopupMenu(somSelf,hwndMenu,hwndCnr,ulPosition));
  13121.   }
  13122.  
  13123. Adding Class-Specific Items to an Object's Pop-Up Menu 
  13124.  
  13125. The wpInsertPopupMenuItems method requires a handle to the module where the 
  13126. menu resource is defined,  the ID for the menu resource, and the ID for the 
  13127. menu where the item is being inserted.  In the above example, ID_MOREITEMS is 
  13128. the ID for the menu resource that defines the new menu item being added to the 
  13129. object's primary pop-up menu. WPMENUID_PRIMARY is the ID for the object's 
  13130. primary pop-up menu, where New Items is being inserted. 
  13131.  
  13132. An item can be added to a pop-up menu sub-menu or conditional cascaded menu by 
  13133. specifying the ID for the conditional cascaded menu on the call to the 
  13134. wpInsertPopupMenuItems method.  For example, to add New Items to the Open 
  13135. conditional cascaded menu, the call to wpInsertPopupMenuItems is modified as 
  13136. shown in the following figure. 
  13137.  
  13138.   /* Insert new items in MyObject's Open SubMenu if flag is set  */
  13139.   if (flags & MYCTXT_NEWITEM)
  13140.      _wpInsertPopupMenuItemsA(somSelf, hwndMenu, ulPosition, hmod,
  13141.                              ID_MOREITEMS, WPMENUID_OPEN);
  13142.  
  13143. Adding an Item to a Pop-Up Menu Sub-Menu
  13144.  
  13145.  
  13146. ΓòÉΓòÉΓòÉ 8.3.1.2.3. Removing Class-Specific Items from an Object's Pop-Up Menu ΓòÉΓòÉΓòÉ
  13147.  
  13148. Class-specific pop-up menu items inherited from ancestor classes are removed by 
  13149. overriding the filtering methods that return flags that represent those items. 
  13150. For example, suppose MyObject is the parent class of YourObject, but YourObject 
  13151. has no requirement for the New Item in the pop-up menu it inherits from 
  13152. MyObject.  To remove New Item from YourObject's pop-up menu, YourObject's class 
  13153. overrides wpMyFilterPopupMenu method and does not return the MYCTXT_NEWITEM 
  13154. flag MyObject defined for New Item.  This technique, as shown in the following 
  13155. figure, is similar to that described for removing standard items from an 
  13156. object's context menu.  It requires that MyObject publish wpMyFilterPopupMenu 
  13157. method, as well as the MYCTXT_NEWITEM flag so that subclasses of MyObject can 
  13158. remove or add New Item. 
  13159.  
  13160.   /*                     Method Override                         */
  13161.   /*   Filter new items added to MyObject's pop-up menu          */
  13162.   SOM_Scope ULONG  SOMLINK YourObject_wpMyFilterPopupMenu(
  13163.     YourObject *somSelf, ULONG ulFlags, HWND hwndCnr, BOOL32 fMultiSelect)
  13164.   {
  13165.  
  13166.   return(0);    /* Return no flags so that 'New Item' is not     */
  13167.                 /* included in YourObject's pop-up menu          */
  13168.   }
  13169.  
  13170. Removing Class-Specific Items from a Pop-Up Menu 
  13171.  
  13172.  
  13173. ΓòÉΓòÉΓòÉ 8.3.1.2.4. Adding Conditional Cascaded Menus to the Primary Pop-Up Menu ΓòÉΓòÉΓòÉ
  13174.  
  13175. Items on an object's pop-up menu sometimes have pull-down menus or sub-menus 
  13176. associated with them.  In the Workplace, pop-up sub-menus are conditional 
  13177. cascaded menus, as shown in the following figure. 
  13178.  
  13179.                    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13180.                    Γöé  Open      (->) Γöé
  13181.                    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13182.                    Γöé  Help           Γöé
  13183.                    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13184.                    Γöé  Print          Γöé
  13185.                    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13186.                    Γöé  New Item  (->) Γöé SubItem_1    Γöé
  13187.                    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13188.                                      Γöé SubItem_2    Γöé
  13189.                                      Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13190.                                      Γöé SubItem_3    Γöé
  13191.                                      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13192.  
  13193. Conditional Cascaded Menus 
  13194.  
  13195. In the previous example, New Item is not a pull-down menu. However, New Item 
  13196. can be defined as a pull-down menu by defining it as a sub-menu in MyObject's 
  13197. resource file, as shown in the following figure. 
  13198.  
  13199.   #define ID_MOREITEMS   WPMENUID_USER+1
  13200.   #define ID_NEWITEMS    WPMENUID_USER+2
  13201.   #define ID_SUBITEM1    WPMENUID_USER+3
  13202.   #define ID_SUBITEM2    WPMENUID_USER+4
  13203.   #define ID_SUBITEM3    WPMENUID_USER+5
  13204.  
  13205.   MENU ID_MOREITEMS LOADONCALL MOVEABLE DISCARDABLE
  13206.   BEGIN
  13207.     SUBMENU "New Item", ID_NEWITEMS
  13208.       BEGIN
  13209.         MENUITEM "SubItem_1"     ID_SUBITEM1
  13210.         MENUITEM "SubItem_2"     ID_SUBITEM2
  13211.         MENUITEM "SubItem_3"     ID_SUBITEM3
  13212.       END
  13213.   END
  13214.  
  13215. Resource File Defining Pull-Down for Object's Pop-Up Menu 
  13216.  
  13217. The New Item sub-menu is added to MyObject's primary pop-up menu using the same 
  13218. technique as shown in the following figure. For the Shell to display the 
  13219. sub-menu as a conditional cascade menu with the mini-push button and default 
  13220. selection, the menu's style and default selection must be set, as shown in the 
  13221. following figure. 
  13222.  
  13223.   /*                     Method Override                         */
  13224.   /*     Add a new item to MyObject's pop-up menu                */
  13225.  
  13226.   SOM_SCOPE BOOL32 SOMLINK MyObject_wpModifyPopupMenu(MyObject *somSelf,
  13227.                            HWND hwndMenu, HWND hwndCnr, ULONG iPosition)
  13228.   {
  13229.   .
  13230.   MENUITEM mi;
  13231.   .
  13232.   .
  13233.   .
  13234.   /* Get a handle to the New Item submenu                        */
  13235.   WinSendMsg(hwndMenu, MM_QUERYITEM,
  13236.              MPFROM2SHORT(ID_NEWITEMS), (MPARAM)&mi);
  13237.   hwndSubMenu=mi.hwndSubMenu;
  13238.  
  13239.   /* Query the menu's style                                      */
  13240.   ulstyle=WinQueryWindowULong(hwndSubMenu, QWL_STYLE);
  13241.  
  13242.   /* Add conditional cascade capabilities to existing menu style */
  13243.   ulstyle |= MS_CONDITIONALCASCADE;
  13244.  
  13245.   /* Set menu style to include conditional cascade capabilities  */
  13246.   WinSetWindowULong(hwndSubMenu, QWL_STYLE, ulstyle);
  13247.  
  13248.   /* Set the default selection in the submenu - it must exist    */
  13249.   WinSendMsg(hwndSubMenu, MM_SETDEFAULTITEMID, (MPARAM)ID_SUBITEM1, 0L);
  13250.   .
  13251.   .
  13252.   }
  13253.  
  13254. Creating a Conditional Cascaded Menu for a Pop-Up Menu Item 
  13255.  
  13256.  
  13257. ΓòÉΓòÉΓòÉ 8.3.1.2.5. Supporting User Selection of New Pop-Up Menu Items ΓòÉΓòÉΓòÉ
  13258.  
  13259. When a class defines new actions for its pop-up menu, it must provide for the 
  13260. processing of the actions when the user selects the action. This is done by 
  13261. overriding the pop-up menu methods shown in the following table. 
  13262.  
  13263. Pop-Up Menu Methods that Support New Pop-Up Menu Items 
  13264.  
  13265. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13266. ΓöéMethod              ΓöéDescription                             Γöé
  13267. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13268. ΓöéwpMenuItemHelpSelectΓöéDisplays the help associated with       Γöé
  13269. Γöé                    Γöéclass-specific pop-up menu item.        Γöé
  13270. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13271. ΓöéwpMenuItemSelected  ΓöéProcesses class-specific pop-up menu    Γöé
  13272. Γöé                    Γöéitem.                                   Γöé
  13273. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13274.  
  13275. Using the previous example, MyObject supports SubItem_1 by overriding the 
  13276. wpMenuItemSelected method as shown in the following figure. 
  13277.  
  13278.   /*                   Method Override                       */
  13279.   /* Process input from the extra menu option that we added. */
  13280.  
  13281.   SOM_Scope void   SOMLINK MyObject_wpMenuItemSelected(MyObject *self,
  13282.                          HWND hwndFrame, ULONG MenuID)
  13283.   {
  13284.     .
  13285.     /* Which of our menu items was selected ?  */
  13286.     switch( MenuId )
  13287.     {
  13288.        case ID_SUBITEM1:
  13289.            .
  13290.        case ID_SUBITEM2:
  13291.            .
  13292.        case ID_SUBITEM3:
  13293.            .
  13294.        case ID_SUBITEM4:
  13295.            .
  13296.        default:
  13297.             parent_wpMenuItemSelected
  13298.      }
  13299.  
  13300. Supporting User Selection of New Pop-Up Menu Items 
  13301.  
  13302. MyObject can support help for new pop-up menu items by overriding the 
  13303. wpMenuItemHelpSelected method in a similar manner. 
  13304.  
  13305.  
  13306. ΓòÉΓòÉΓòÉ 8.3.1.2.6. Support for User Selection of Standard Pop-Up Menu Items ΓòÉΓòÉΓòÉ
  13307.  
  13308. When the user selects a standard action from a pop-up menu, the Shell calls one 
  13309. of the pop-up menu methods shown in the following table. 
  13310.  
  13311. Pop-Up Menu Methods Supporting Standard Pop-Up Menu Items 
  13312.  
  13313. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13314. ΓöéMethod              ΓöéDescription                             Γöé
  13315. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13316. ΓöéwpClose             ΓöéCloses all open views of an object.     Γöé
  13317. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13318. ΓöéwpCopyObject        ΓöéCreates a new copy of the object.       Γöé
  13319. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13320. ΓöéwpCreateFromTemplateΓöéCreates an object from a template.      Γöé
  13321. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13322. ΓöéwpCreateShadowObjectΓöéCreates a shadow of an object.          Γöé
  13323. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13324. ΓöéwpDelete            ΓöéDeletes an object and prompts for       Γöé
  13325. Γöé                    Γöéconfirmation if necessary.              Γöé
  13326. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13327. ΓöéwpDisplayHelp       ΓöéDisplays a help panel.                  Γöé
  13328. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13329. ΓöéwpHide              ΓöéHides or minimizes open views of an     Γöé
  13330. Γöé                    Γöéobject.                                 Γöé
  13331. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13332. ΓöéwpRestore           ΓöéRestores hidden or minimized views of anΓöé
  13333. Γöé                    Γöéobject.                                 Γöé
  13334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13335. ΓöéwpMoveObject        ΓöéMoves the object to a different         Γöé
  13336. Γöé                    Γöélocation.                               Γöé
  13337. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13338. ΓöéwpOpen              ΓöéOpens a view of the object.             Γöé
  13339. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13340. ΓöéwpPrintObject       ΓöéPrints a view of the object.            Γöé
  13341. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13342.  
  13343.  
  13344. ΓòÉΓòÉΓòÉ 8.3.1.2.7. Open Views ΓòÉΓòÉΓòÉ
  13345.  
  13346. Objects can have Open Actions or Open Views associated with them.  Open Views 
  13347. typically are the views of an object (for example, icon, details, and 
  13348. settings).  Open Views (for data file objects) also include programs or program 
  13349. references that the user has associated with the object. Open Views are 
  13350. displayed when the user selects the cascade mini-push button that appears next 
  13351. to the Open action on the pop-up menu.  The user then can select the default 
  13352. Open View or any of the Open Views that are listed in the conditional cascade 
  13353. menu. 
  13354.  
  13355. The Workplace defines a set of predefined Open Views for Workplace objects, as 
  13356. shown in the following table. Some of the predefined Open Views are meaningful 
  13357. only to certain Workplace classes: OPEN_RUNNING is meaningful only to a program 
  13358. or program reference object;  OPEN_TREE is meaningful only to file system 
  13359. objects such as folders, drives and directories. 
  13360.  
  13361. Predefined Open Views for Workplace Objects 
  13362.  
  13363. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13364. ΓöéView                ΓöéDescription                             Γöé
  13365. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13366. ΓöéOPEN_CONTENTS       ΓöéOpens content view.                     Γöé
  13367. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13368. ΓöéOPEN_DEFAULT        ΓöéOpens default view.                     Γöé
  13369. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13370. ΓöéOPEN_DETAILS        ΓöéOpens details view.                     Γöé
  13371. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13372. ΓöéOPEN_HELP           ΓöéOpens help view.                        Γöé
  13373. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13374. ΓöéOPEN_RUNNING        ΓöéExecutes object.                        Γöé
  13375. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13376. ΓöéOPEN_SETTINGS       ΓöéOpens settings notebook.                Γöé
  13377. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13378. ΓöéOPEN_TREE           ΓöéOpens tree view.                        Γöé
  13379. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13380. ΓöéOPEN_USER           ΓöéOpens class-specific view (value greaterΓöé
  13381. Γöé                    Γöéthan OPEN_USER)                         Γöé
  13382. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13383.  
  13384. Workplace classes can define new Open Views for their objects by: 
  13385.  
  13386.  1. Adding the New View menu item to the Open sub-menu. 
  13387.  
  13388.  2. Overriding the wpMenuItemSelected method to support user selection of the 
  13389.     New View menu item. 
  13390.  
  13391.  3. Overriding the wpOpen method to open the New View. 
  13392.  
  13393.  4. Creating and opening a standard window for the New View by calling 
  13394.     WinCreateStdWindow. 
  13395.  
  13396.     Note:  The preferred method for displaying application views of an object 
  13397.            is for the object to start a separate process (using DosExecPgm) for 
  13398.            the application. This approach moves the larger part of the 
  13399.            application code out of the Shell's process, thus conserving the 
  13400.            Shell's resources. It also helps prevent a misbehaved application 
  13401.            from potentially interfering with the execution of the Shell. 
  13402.  
  13403.  5. Adding a USAGE_VIEW item to the object's in-use list by calling the 
  13404.     wpAddToObjUseList method. 
  13405.  
  13406.  6. Registering the New View by calling the wpRegisterView method. 
  13407.  
  13408. The CAR Sample Workplace Object in the Toolkit demonstrates how to define and 
  13409. open a new Open View. 
  13410.  
  13411.  
  13412. ΓòÉΓòÉΓòÉ 8.3.1.2.8. Object Shadows ΓòÉΓòÉΓòÉ
  13413.  
  13414. A shadow of an object is an object that refers to another object's data.  A 
  13415. shadow object often can appear to be a copy of the object that it refers to. 
  13416. However, it is not a copy but another representation of the object.  This means 
  13417. that when data in a shadow object is changed, the same data is changed in the 
  13418. original object and all references to it.  This is in contrast to a copy of an 
  13419. object, such as a data file, where the data in the copy can be changed and not 
  13420. affect the original. 
  13421.  
  13422. Some objects cannot be copied and only a shadow can be created in order to have 
  13423. that object reside in multiple folders.  These typically are device objects. 
  13424. For example, because there is only one physical mouse device in the system, 
  13425. there cannot be two different mouse objects. 
  13426.  
  13427. A shadow is created by the user by direct manipulation (holding CTRL+SHIFT keys 
  13428. down while dragging/dropping the object) or by selecting Create Shadow on the 
  13429. pop-up menu.  In both cases, the Shell responds by calling the object's 
  13430. wpCreateShadowObject method. 
  13431.  
  13432.  
  13433. ΓòÉΓòÉΓòÉ 8.3.1.2.9. Helps for Objects ΓòÉΓòÉΓòÉ
  13434.  
  13435. Help for Workplace objects is provided in the same manner as for PM 
  13436. applications using the Information Presentation Facility (IPF).  Help instances 
  13437. are created for and associated with objects by the Shell.  Help panels for 
  13438. windows and window controls are created using the IPF tag language and compiled 
  13439. by the IPF compiler into a Help Library.  The Help Library is placed in the 
  13440. systems's \OS2\HELP directory or in another directory in the LIBPATH.  Help 
  13441. panels are associated with windows and window controls by help tables defined 
  13442. in the object's resource file.  See the Information Presentation Facility Guide 
  13443. and Reference in the OS/2 2.0 Technical Library for more information on 
  13444. creating Help panels and Help libraries. 
  13445.  
  13446. Help for Workplace objects is supported by the object's wpDisplayHelp, 
  13447. wpQueryDefaultHelp and wpMenuItemHelpSelected methods. The wpQueryDefaultHelp 
  13448. and wpMenuItemHelpSelected methods are overridden to support class-specific 
  13449. views and menu items. 
  13450.  
  13451.  
  13452. ΓòÉΓòÉΓòÉ 8.3.1.3. Object Information Methods ΓòÉΓòÉΓòÉ
  13453.  
  13454. Object information methods permit you to set and query information (default 
  13455. help and view, details, icon and icon, style, and title) associated with an 
  13456. object.  The methods in this group set and query object information as shown in 
  13457. the following table. 
  13458.  
  13459. Object Information Methods 
  13460.  
  13461. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13462. ΓöéMethods                       ΓöéOperate on                    Γöé
  13463. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13464. ΓöéwpSet/wpQueryDefaultHelp      ΓöéDefault help panel for object Γöé
  13465. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13466. ΓöéwpSet/wpQueryDefaultView      ΓöéDefault view for object       Γöé
  13467. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13468. ΓöéwpQueryDetailsData            ΓöéCurrent details data for      Γöé
  13469. Γöé                              Γöéobject                        Γöé
  13470. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13471. ΓöéwpSet/wpQueryIcon             ΓöéCurrent icon for an object    Γöé
  13472. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13473. ΓöéwpSet/wpQueryIconData         ΓöéCurrent icon and icon data forΓöé
  13474. Γöé                              Γöéan object                     Γöé
  13475. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13476. ΓöéwpSet/wpQueryStyle            ΓöéCurrent style of an object    Γöé
  13477. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13478. ΓöéwpSet/wpQueryTitle            ΓöéCurrent title of an object    Γöé
  13479. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13480.  
  13481.  
  13482. ΓòÉΓòÉΓòÉ 8.3.1.3.1. Object Styles ΓòÉΓòÉΓòÉ
  13483.  
  13484. Just as PM windows have class styles, Workplace objects have object (instance) 
  13485. styles, as shown in the following table. Object instance styles define object 
  13486. behavior.  They can be changed after an object has been created by calling the 
  13487. wpSetStyle method. 
  13488.  
  13489. Object Class Styles 
  13490.  
  13491. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13492. ΓöéStyle                         ΓöéDescription                   Γöé
  13493. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13494. ΓöéOBJSTYLE_NOCOPY               ΓöéCannot be copied.             Γöé
  13495. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13496. ΓöéOBJSTYLE_NODELETE             ΓöéCannot be deleted.            Γöé
  13497. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13498. ΓöéOBJSTYLE_NODRAG               ΓöéCannot be dragged.            Γöé
  13499. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13500. ΓöéOBJSTYLE_NOSHADOW             ΓöéCannot have shadow created.   Γöé
  13501. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13502. ΓöéOBJSTYLE_NOMOVE               ΓöéCannot move.                  Γöé
  13503. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13504. ΓöéOBJSTYLE_NOPRINT              ΓöéCannot be printed.            Γöé
  13505. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13506. ΓöéOBJSTYLE_NOTDEFAULTICON       ΓöéDestroys icon when object goesΓöé
  13507. Γöé                              Γöédormant.                      Γöé
  13508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13509. ΓöéOBJSTYLE_TEMPLATE             ΓöéObject is a template.         Γöé
  13510. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13511. ΓöéOBJSTYLE_NOTVISIBLE           ΓöéObject is hidden.             Γöé
  13512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13513. ΓöéOBJSTYLE_NORENAME             ΓöéObject cannot be renamed.     Γöé
  13514. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13515.  
  13516.  
  13517. ΓòÉΓòÉΓòÉ 8.3.1.3.2. Object Templates ΓòÉΓòÉΓòÉ
  13518.  
  13519. An object template is the primary user mechanism for creating new instances of 
  13520. objects.  Specifically, a template is a state of an object where the default 
  13521. drag operation is Create another, that is, dragging and dropping the template 
  13522. results in the creation of an instance of the object.  The visual 
  13523. representation of a template is the object's icon on top of a "yellow sticky 
  13524. pad" with the top sheet slightly peeled up. Any object that supports the Create 
  13525. another action can be changed by the user to and from a template state by 
  13526. selecting the template check box on the General page in the object's Settings 
  13527. Notebook. A template is created automatically when a class is registered, 
  13528. unless the class wpclsQueryStyle class method returns CLSSTYLE_NEVERTEMPLATE. 
  13529.  
  13530. When the operating system is first installed, template objects reside in the 
  13531. Templates folder on the Desktop.  The Templates folder always contains a 
  13532. template object for each class of object installed on the system that supports 
  13533. the Create Another action. Any new object registered by the 
  13534. WinRegisterObjectClass function that supports the Create Another action 
  13535. automatically appears in this folder.  A template for each object class 
  13536. registered using this function cannot be removed from the Templates folder. 
  13537.  
  13538.  
  13539. ΓòÉΓòÉΓòÉ 8.3.1.3.3. Object Details ΓòÉΓòÉΓòÉ
  13540.  
  13541. Some Workplace classes define a set of information that a user can display in a 
  13542. details view of all instances of objects belonging to the class.  A details 
  13543. view is a Presentation Manager container control window. For more information 
  13544. on Presentation Manager container control windows, see OS/2 Programming Guide, 
  13545. Volume II in the OS/2 2.0 Technical Library. 
  13546.  
  13547. A details view, as represented in the following figure, consists of a window 
  13548. with data arranged in columns that have headings. A row of data, also known as 
  13549. a record, provides information for a specific instance of an object belonging 
  13550. to the class.  Each element in the details view can be text, icons, or bit 
  13551. maps.  OWNERDRAW of elements also is supported. 
  13552.  
  13553.                            Details for Instances of MyObject Class
  13554.               ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13555.               Γöé Item1 Γöé Item2 Γöé Item3 Γöé Item4 Γöé Item5 Γöé Item6 Γöé Item7 ΓöéItem8 Γöé
  13556.               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13557.   Instance 1  Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé      Γöé
  13558.               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13559.   Instance 2  Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé      Γöé
  13560.               Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13561.               Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé      Γöé
  13562.               Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé       Γöé      Γöé
  13563.               ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13564.  
  13565. Details View for a Workplace Class 
  13566.  
  13567. The column headings for a details view are specified by overriding the 
  13568. wpclsQueryDetailsInfo class method.  A record that contains information for an 
  13569. object instance of the class is constructed by overriding the 
  13570. wpQueryDetailsData instance method. 
  13571.  
  13572. An object can inherit the set of details defined by its ancestors.  A record 
  13573. containing details information for an object, therefore, can contain sets of 
  13574. details for the object that are defined by its parent, its grandparent, and so 
  13575. forth. To meet this requirement, the Workplace constructs records as contiguous 
  13576. blocks of memory. 
  13577.  
  13578. A record is built for an object by the override to the wpQueryDetailsData 
  13579. instance method. To inherit the details defined by ancestor classes, 
  13580. wpQueryDetailsData calls the parent class's wpQueryDetailsData method, which 
  13581. calls its parent class's wpQueryDetailsData method, and so forth, through the 
  13582. oldest ancestor that defines details data. With each call to 
  13583. wpQueryDetailsData, a variable length block of memory containing a set of 
  13584. details for the object is added to the record. A pointer is moved also to the 
  13585. end of the last block of memory added to the record where the next call to 
  13586. wpQueryDetailsData adds the next block of memory. As shown in the following 
  13587. figure, each block in the record contains a set of details for the object 
  13588. defined by its class or by one of its ancestor classes. 
  13589.  
  13590.  
  13591.     ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  13592.            Γöé Details defined Γöé Details defined Γöé Details defined Γöé
  13593.            Γöé by MyObject's   Γöé by MyObject's   Γöé by MyObject     Γöé
  13594.            Γöé grandparent     Γöé parent          Γöé                 Γöé
  13595.     ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  13596.  
  13597. A Details Record for an Object 
  13598.  
  13599. The format for details information contained in a record is defined in an 
  13600. override to the wpclsQueryDetailsInfo class method.  The format is defined in a 
  13601. linked list of CLASSFIELDINFO data structures for each details data item in a 
  13602. record. This linked list is constructed the same as a record: 
  13603. wpclsQueryDetailsInfo calls its parent class's wpclsQueryDetailsInfo method, 
  13604. which calls its parent class's wpclsQueryDetailsInfo method, and so forth. As 
  13605. shown in the following figure, each call adds a set of CLASSFIELDINFO data 
  13606. structures to the linked list until the linked list contains CLASSFIELDINFO 
  13607. data structures for each details data item in the object's details record. 
  13608.  
  13609.  
  13610.     Format of           Format of           Format of
  13611.     Details defined     Details defined     Details defined
  13612.     by grandparent      by parent           MyObject
  13613.     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13614.  ΓöÇΓöÇ>fitem1ΓöÇ>fitem2ΓöÇΓöÇΓöÇΓöÇΓöÇ>fitem3ΓöÇ>fitem4ΓöÇΓöÇΓöÇΓöÇΓöÇ>fitem5ΓöÇ>fitem6ΓöÇ>fitem7ΓöÇ>fitem8ΓöÇΓöÇΓöÇ>
  13615.  
  13616.  
  13617. Format for Items in a Details Record for an Object 
  13618.  
  13619. The CLASSFIELDINFO data structure is defined in the header files provided with 
  13620. the OS/2 2.0 Toolkit.  It describes the attributes of details data in a 
  13621. particular column.  It includes the title for the column heading and the format 
  13622. of the data. The flags used to specify the attribute of the title for the field 
  13623. and the data within the field are the same as those used in the container 
  13624. control window's FIELDINFO data structure. 
  13625.  
  13626. The CAR Sample Workplace Object in the OS/2 2.0 Toolkit can be used to 
  13627. illustrate the requirements for defining details data for a class of objects. 
  13628. CAR can provide details data for CAR objects by: 
  13629.  
  13630.  1. Defining a data structure for the items to be included in the details view. 
  13631.     as shown in the following figure. 
  13632.  
  13633.             /* CARDETAILS:  Structure used for details view  */
  13634.  
  13635.             typedef struct _CARDETAILS {
  13636.               PSZ      pszMake;     // Manufacturer
  13637.               PSZ      pszModel;    // Model
  13638.               PSZ      pszColor;    // Color of car
  13639.               CDATE    cdateSale;   // Date of sale
  13640.               ULONG    ulPrice;     // Price in dollars
  13641.             } CARDETAILS;
  13642.             typedef CARDETAILS *PCARDETAILS;
  13643.  
  13644.     Defining a Structure for CAR Details 
  13645.  
  13646.  2. Defining and initializing a static array of CLASSFIELDINFO structures for 
  13647.     each detail, as shown in the following figure. This is done on class 
  13648.     initialization, when wpclsInitData is called. 
  13649.  
  13650.     Note:  Title and Icon details are defined for CAR objects by its ancestor 
  13651.            class WPObject.  This means that CLASSFIELDINFO structures for Title 
  13652.            and Icon details are defined and initialized in the WPObject class 
  13653.            definition. 
  13654.  
  13655.  
  13656.         InitializingCLASSFIELDINFOStructuresforCARDetails
  13657.  
  13658.            #define NUM_CAR_FIELDS    5
  13659.  
  13660.            CLASSFIELDINFO fieldinfo[NUM_CAR_FIELDS];
  13661.  
  13662.            PSZ pszCarColTitles[] = {"Make", "Model","Color","Sale date","Price ($)"};
  13663.  
  13664.            .
  13665.            .
  13666.            //
  13667.            // METHOD: wpclsInitData                                  ( ) PRIVATE
  13668.            //                                                        (X) PUBLIC
  13669.            // PURPOSE:
  13670.            //   Initialize the details data
  13671.            //
  13672.            SOM_Scope void SOMLINK carM_wpclsInitData(M_Car *somSelf)
  13673.            {
  13674.               USHORT          i;
  13675.               PCLASSFIELDINFO pCFI;
  13676.  
  13677.               /*  Call the parent class method first                             */
  13678.               parent_wpclsInitData(somSelf);
  13679.  
  13680.               /* Initialize everything needed for the CLASSFIELDINFO structures  */
  13681.               /* for the CAR object class                                        */
  13682.               for (i=0,pCFI=fieldinfo;i<NUM_CAR_FIELDS;i++,pCFI++)
  13683.               {
  13684.                  /* memset the structure to zero's                               */
  13685.                  memset((PCH)pCFI,0,sizeof(CLASSFIELDINFO));
  13686.  
  13687.                  pCFI->cb        = sizeof(CLASSFIELDINFO);
  13688.                  pCFI->flData    = CFA_RIGHT | CFA_SEPARATOR | CFA_FIREADONLY;
  13689.                  pCFI->flTitle   = CFA_CENTER | CFA_SEPARATOR | CFA_HORZSEPARATOR |
  13690.                                    CFA_STRING | CFA_FITITLEREADONLY;
  13691.                  pCFI->pNextFieldInfo = pCFI + 1;
  13692.                  pCFI->pTitleData = pszCarColTitles[i];
  13693.                  pCFI->flCompare  = COMPARE_SUPPORTED;
  13694.  
  13695.                  switch (i)
  13696.                  {
  13697.                     case 0:
  13698.                        pCFI->flData        |= CFA_STRING;
  13699.                        pCFI->offFieldData   = (ULONG)(FIELDOFFSET(CARDETAILS,pszMake));
  13700.                        pCFI->ulLenFieldData = sizeof(PSZ);
  13701.                        break;
  13702.                     case 1:
  13703.                        pCFI->flData        |= CFA_STRING;
  13704.                        pCFI->offFieldData   = (ULONG)(FIELDOFFSET(CARDETAILS,pszModel));
  13705.                        pCFI->ulLenFieldData = sizeof(PSZ);
  13706.                        break;
  13707.                     case 2:
  13708.                        pCFI->flData        |= CFA_STRING;
  13709.                        pCFI->offFieldData   = (ULONG)(FIELDOFFSET(CARDETAILS,pszColor));
  13710.                        pCFI->ulLenFieldData = sizeof(PSZ);
  13711.                        break;
  13712.                     case 3:
  13713.                        pCFI->flData        |= CFA_DATE;
  13714.                        pCFI->offFieldData   = (ULONG)(FIELDOFFSET(CARDETAILS,cdateSale));
  13715.                        pCFI->ulLenFieldData = sizeof(CDATE);
  13716.                        break;
  13717.                     case 4:
  13718.                        pCFI->flData        |= CFA_ULONG;
  13719.                        pCFI->offFieldData   = (ULONG)(FIELDOFFSET(CARDETAILS,ulPrice));
  13720.                        pCFI->ulLenFieldData = sizeof(ULONG);
  13721.                        break;
  13722.                  }
  13723.               }
  13724.               fieldinfo[NUM_CAR_FIELDS-1].pNextFieldInfo = NULL;
  13725.            }
  13726.  
  13727.  3. Defining the column headings and format of the details data placed into the 
  13728.     object's details record by overriding the wpclsQueryDetailsInfo class 
  13729.     method, as shown in the following figure. 
  13730.  
  13731.            //
  13732.            // OVERRIDE: wpclsQueryDetailsInfo
  13733.            //
  13734.            // Let parent know the size of the RECORDCORE devoted to data from CAR
  13735.            // if pSize is NON-NULL
  13736.            //
  13737.            // Link in the Car CLASSFIELDINFO chain if pp is NON_NULL
  13738.            //
  13739.            SOM_Scope ULONG SOMLINK redcarM_wpclsQueryDetailsInfo(M_Car *self,
  13740.                                                            PCLASSFIELDINFO *pp,
  13741.                                                            PULONG pSize)
  13742.            {
  13743.            /* M_CarData       *somThis = M_CarGetData(self); */
  13744.               ULONG           n_prev_cols;
  13745.               PCLASSFIELDINFO pCFI;
  13746.               ULONG           i;
  13747.               M_CarMethodDebug("M_Car","carM_wpclsQueryDetailsInfo");
  13748.  
  13749.               /* Always call the parent method first */
  13750.               n_prev_cols = parent_wpclsQueryDetailsInfo(self,pp,pSize);
  13751.  
  13752.               /* If the request was for the size of the car details column data,
  13753.                * size needed by the car details */
  13754.               if (pSize)
  13755.                  *pSize += sizeof(CARDETAILS);
  13756.  
  13757.               /* If the request was for the chained fieldinfo structures,
  13758.                * link them in
  13759.                * eventually the chain will look like
  13760.                *
  13761.                * Grandparent - Parent - Me - Child - Grandchild
  13762.                *
  13763.                * I will be getting the pointer to the beginning of the chain
  13764.                * If the beginning of the chain is 0, I will assign the address
  13765.                * of my first CLASSFIELDINFO structure to *pp.
  13766.                * Otherwise *pp points to the first column description in the
  13767.                * chain.  We need to walk the chain and link our CLASSFIELDINFO
  13768.                * structures at the end.
  13769.                */
  13770.               if (pp)
  13771.               {
  13772.                  /* Link our CLASSFIELDINFO structures to the chain
  13773.                   * find the last link in the chain */
  13774.                  if (pCFI = *pp)
  13775.                  {
  13776.                     for (i=0;i<n_prev_cols;i++)
  13777.                         pCFI = (pCFI->pNextFieldInfo) ? pCFI->pNextFieldInfo : pCFI;
  13778.  
  13779.                     pCFI->pNextFieldInfo = fieldinfo;
  13780.                  }
  13781.                  else
  13782.                     *pp = fieldinfo;
  13783.               }
  13784.               return ((ULONG) (n_prev_cols + NUM_CAR_FIELDS));
  13785.            }
  13786.  
  13787.     Defining Format of Details Data 
  13788.  
  13789.  4. Adding details data to object's Details record by overriding the 
  13790.     wpQueryDetailsData instance method, as shown in the following figure. 
  13791.  
  13792.            //
  13793.            // Append details data to the end of the RECORDCORE structure
  13794.            //
  13795.            SOM_Scope ULONG SOMLINK car_wpQueryDetailsData
  13796.                                          (Car *self, PVOID *ppDetailsData)
  13797.            {
  13798.               PCARDETAILS pCD;
  13799.  
  13800.               CarData *somThis = CarGetData(self);
  13801.               CarMethodDebug("Car","car_wpQueryDetailsData");
  13802.  
  13803.               parent_wpQueryDetailsData(self,ppDetailsData);
  13804.  
  13805.               pCD                  = (PCARDETAILS) *ppDetailsData;
  13806.               pCD->pszMake         = "Volkswagen";      /* Manufacturer     */
  13807.               pCD->pszModel        = "Cabriolet";       /* Model name       */
  13808.               pCD->pszColor        = "RED";             /* Color of the car */
  13809.               pCD->cdateSale.day   = 24;                /* Date of sale     */
  13810.               pCD->cdateSale.month = 12;
  13811.               pCD->cdateSale.year  = 91;
  13812.               pCD->ulPrice         = 14000;             /* Price in dollars */
  13813.  
  13814.               ((PBYTE) (*ppDetailsData)) += sizeof(CARDETAILS);
  13815.  
  13816.               return(TRUE);
  13817.            }
  13818.  
  13819.     Appending Details Data to end of Object's Details Record 
  13820.  
  13821.  
  13822. ΓòÉΓòÉΓòÉ 8.3.1.4. Direct Manipulation Methods ΓòÉΓòÉΓòÉ
  13823.  
  13824. Direct Manipulation methods support dragging and dropping one object on another 
  13825. object. The object being dragged is the source object, and the object on which 
  13826. the source object is dropped is the target object. The Workplace Shell tracks a 
  13827. source object that the user drags, and notifies target objects and windows when 
  13828. the source object is being dragged over them and when it is dropped on them. 
  13829. For target objects in the Workplace, the Shell calls the target object's Direct 
  13830. Manipulation methods to process the source object being dragged and dropped. 
  13831.  
  13832. For PM applications, the Shell sends DM_ messages to PM windows using the 
  13833. standard Drag and Drop protocol. The Shell will drag source objects rendered as 
  13834. OBJECT or as OS2FILE and will accept source objects rendered in the same way. 
  13835. The Shell also will send a DM_PRINTOBJECT message to items dropped on the 
  13836. printer object. 
  13837.  
  13838. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13839. ΓöéUsage Note:  Users can drag source objects over windows thatΓöé
  13840. Γöéan object creates. When this occurs, the Shell sends DM_    Γöé
  13841. Γöémessages to these windows. Therefore, window procedures     Γöé
  13842. Γöéassociated with the windows that the object creates must be Γöé
  13843. Γöéable to process the DM_ messages. For more information on   Γöé
  13844. Γöédirect manipulation in PM windows, see the OS/2 Programming Γöé
  13845. ΓöéGuide, Volume II in the OS/2 2.0 Technical Library.         Γöé
  13846. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13847.  
  13848. Target objects are not necessarily able to process every type of source object 
  13849. that is dropped on them. They are, however, capable of processing more than one 
  13850. type of dropped source object. Printer objects, for example, cannot print 
  13851. binary files, but they can print both text files and graphics files. Because of 
  13852. differing capabilities, each target object should determine if it can process 
  13853. the source object being dropped on it. 
  13854.  
  13855. DM Notifications from the Shell to Target Objects and to Windows 
  13856.  
  13857. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13858. ΓöéNotification        ΓöéObjects             ΓöéWindows             Γöé
  13859. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13860. ΓöéFormat drag         ΓöéwpFormatDragItem    ΓöéNone                Γöé
  13861. Γöéinformation         Γöé                    Γöé                    Γöé
  13862. Γöé(source)            Γöé                    Γöé                    Γöé
  13863. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13864. ΓöéRequest rendering   ΓöéwpRender            ΓöéDM_RENDER           Γöé
  13865. Γöéformat (source)     Γöé                    Γöé                    Γöé
  13866. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13867. ΓöéRendering request   ΓöéwpRenderComplete    ΓöéDM_RENDERCOMPLETE   Γöé
  13868. Γöécompleted (source)  Γöé                    Γöé                    Γöé
  13869. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13870. ΓöéObjects being       ΓöéwpDragOver          ΓöéDM_DRAGOVER         Γöé
  13871. Γöédragged over        Γöé                    Γöé                    Γöé
  13872. Γöé(target)            Γöé                    Γöé                    Γöé
  13873. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13874. ΓöéObject has been     ΓöéwpDrop              ΓöéDM_DROP             Γöé
  13875. Γöédropped (target)    Γöé                    Γöé                    Γöé
  13876. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13877. ΓöéDrag/Drop is        ΓöéwpEndConversation   ΓöéDM_ENDCONVERSATION  Γöé
  13878. Γöécomplete (target)   Γöé                    Γöé                    Γöé
  13879. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13880.  
  13881.  
  13882. ΓòÉΓòÉΓòÉ 8.3.1.5. Save/Restore State Methods ΓòÉΓòÉΓòÉ
  13883.  
  13884. The Save/Restore State methods, as shown in the following table. are important 
  13885. to the class definitions of persistent objects. 
  13886.  
  13887. Save/Restore the Object's State Methods 
  13888.  
  13889. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13890. ΓöéMethod                        ΓöéDescription                   Γöé
  13891. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13892. ΓöéwpSaveImmediate               ΓöéSaves the object's state.     Γöé
  13893. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13894. ΓöéwpSaveDeferred                ΓöéAsynchronously saves the      Γöé
  13895. Γöé                              Γöéobject's state.               Γöé
  13896. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13897. ΓöéwpSave/wpRestoreState         ΓöéSaves/restores the object's   Γöé
  13898. Γöé                              Γöéstate.                        Γöé
  13899. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13900. ΓöéwpSave/wpRestoreData          ΓöéSaves/restores blocks of      Γöé
  13901. Γöé                              Γöéinstance data.                Γöé
  13902. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13903. ΓöéwpSave/wpRestoreLong          ΓöéSaves/restores a 32-bit       Γöé
  13904. Γöé                              Γöéinstance data value.          Γöé
  13905. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13906. ΓöéwpSave/wpRestoreString        ΓöéSaves/restores an ASCII       Γöé
  13907. Γöé                              Γöéinstance data string.         Γöé
  13908. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13909.  
  13910. When an object is awakened, wpRestoreState is called by the Shell.  The 
  13911. wpSaveImmediate method calls wpSaveState.  The Shell calls wpSaveImmediate and 
  13912. wpSaveState when an object is closed or made dormant or the system is shut 
  13913. down.  The wpSaveImmediate method can also be called by an object's methods 
  13914. when a critical instance variable is changed.  The wpSaveDeferred method 
  13915. asynchronously saves data and, for performance reasons, should be used in 
  13916. preference to the wpSaveImmediate method. 
  13917.  
  13918. To save or restore data relevant to an object, override the wpSaveState and 
  13919. wpRestoreState methods.  The override for wpSaveState calls wpSaveData, 
  13920. wpSaveLong, and wpSaveString, depending on the type of instance data associated 
  13921. with your object.  Similarly, the override for wpRestoreState calls 
  13922. wpRestoreData, wpRestoreLong, and wpRestoreString. 
  13923.  
  13924.  
  13925. ΓòÉΓòÉΓòÉ 8.3.1.6. Object Usage Methods ΓòÉΓòÉΓòÉ
  13926.  
  13927. Object Usage methods, as shown in the following table, enables an object to 
  13928. keep track of its resources and how it is being used. 
  13929.  
  13930. Object Usage Methods 
  13931.  
  13932. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13933. ΓöéMethod                        ΓöéDescription                   Γöé
  13934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13935. ΓöéwpAddToObjUseList             ΓöéAdds an item to the object's  Γöé
  13936. Γöé                              Γöéin-use list.                  Γöé
  13937. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13938. ΓöéwpDeleteFromObjUseList        ΓöéRemoves an item from the      Γöé
  13939. Γöé                              Γöéobject's in-use list.         Γöé
  13940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13941. ΓöéwpFindUseItem                 ΓöéRetrieves an item from the    Γöé
  13942. Γöé                              Γöéobject's in-use list.         Γöé
  13943. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13944.  
  13945. Every Workplace object in the system has an in-use list.  The in-use list 
  13946. provides the object with information, such as the number of container windows 
  13947. into which the container has been inserted.  It also provides the number of 
  13948. open views (contents and settings) of itself that already exist and how much 
  13949. memory it has allocated. 
  13950.  
  13951. The in-use list is a linked list of USEITEM data structures.  The USEITEM data 
  13952. structure consists of an item type and a pointer to the next USEITEM data 
  13953. structure, and is immediately followed by an item type-specific data structure. 
  13954. The types of items that can be added to an object's in-use list and the 
  13955. type-specific data structures that follow each USEITEM data structure are shown 
  13956. in the following table. 
  13957.  
  13958. Types of In-Use Items for Objects 
  13959.  
  13960. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13961. ΓöéItem           ΓöéDescription                   ΓöéUSEITEM+       Γöé
  13962. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13963. ΓöéUSAGE_MEMORY   ΓöéMemory has been allocated by  ΓöéMEMORYITEM     Γöé
  13964. Γöé               ΓöéwpAllocMem method.            Γöé               Γöé
  13965. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13966. ΓöéUSAGE_OPENVIEW ΓöéA view of the object has been ΓöéVIEWITEM       Γöé
  13967. Γöé               Γöéopened.                       Γöé               Γöé
  13968. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13969. ΓöéUSAGE_RECORD   ΓöéThe object has been inserted  ΓöéRECORDITEM     Γöé
  13970. Γöé               Γöéinto a container window.      Γöé               Γöé
  13971. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13972.  
  13973. The USEITEM, MEMORYITEM, VIEWITEM, and RECORDITEM data structures are shown in 
  13974. the following figure and are defined in the header files that are provided with 
  13975. the Toolkit. 
  13976.  
  13977.   typedef struct _USEITEM {
  13978.      ULONG   type;               /* type of this item     */
  13979.      struct _USEITEM FAR *pNext; /* next item in use list */
  13980.   }USEITEM;
  13981.  
  13982.   typedef struct _MEMORYITEM{
  13983.      ULONG   cbBuffer;           /* Number of bytes in memory block */
  13984.   }MEMORYITEM;
  13985.  
  13986.   typedef struct _VIEWITEM{
  13987.      ULONG   view;               /* Object view that this represents */
  13988.      LHANDLE handle;             /* Open handle                      */
  13989.      ULONG ulViewState;          /* View state flags                 */
  13990.      HWND hwndCnr;               /* Used only by system              */
  13991.      PMINIRECORDCORE             /* Used only by system
  13992.   }VIEWITEM;
  13993.  
  13994.   typedef struct _RECORDITEM{
  13995.      HWND   hwndCnr;/* Container into which object is being inserted */
  13996.      PMINIRECORDCORE pRecord;    /* Record pointer within container  */
  13997.      ULONG  ulUser;              /* For application use              */
  13998.   }RECORDITEM;
  13999.  
  14000. Data Structures for Object In-Use Items 
  14001.  
  14002. The wpAddToObjUseList method adds items to the object's in-use list when the 
  14003. events outlined in the previous table occur.  When memory is allocated for an 
  14004. object by its wpAllocMem method, wpAllocMem calls wpAddToObjUseList to add a 
  14005. USAGE_MEMORY item to the object's in-use list. When a view of an object is 
  14006. opened by the object's wpOpen method, this method is called to add a 
  14007. USAGE_OPENVIEW item to the object's in-use list.  When an object is inserted 
  14008. into a container window, a USAGE_RECORD item is added to the object's in-use 
  14009. list by the object's wpCnrInsertObject method. 
  14010.  
  14011. Conversely, when memory is freed by the object's wpFreeMem method, 
  14012. wpDeleteFromObjUseList is called by wpFreeMem to remove a USAGE_MEMORY item 
  14013. from the object's in-use list.  When views are closed by the object's wpClose 
  14014. method, wpDeleteFromObjUseList removes a USAGE_VIEW item from the object's 
  14015. in-use list.  When objects are removed from a container window by the object's 
  14016. wpCnrRemoveObject method, wpDeleteFromObjUseList removes a USAGE_RECORD item 
  14017. from the object's in-use list. 
  14018.  
  14019. wpFindUseItem is used to determine how an object currently is being used.  It 
  14020. searches an object's in-use list for items of a specified type and returns a 
  14021. pointer to the USEITEM structure that matches that specified type. 
  14022.  
  14023.  
  14024. ΓòÉΓòÉΓòÉ 8.3.1.7. Setup/Cleanup Methods ΓòÉΓòÉΓòÉ
  14025.  
  14026. Setup/Cleanup Methods, as shown in the following table, support object 
  14027. initialization and destruction. 
  14028.  
  14029. Setup/Cleanup Methods 
  14030.  
  14031. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14032. ΓöéMethod              ΓöéDescription                             Γöé
  14033. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14034. ΓöéwpFree              ΓöéDestroys the object and de-allocates itsΓöé
  14035. Γöé                    Γöéassociated resources.                   Γöé
  14036. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14037. ΓöéwpInitData          ΓöéAllocates and initializes the object's  Γöé
  14038. Γöé                    Γöéinstance data.                          Γöé
  14039. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14040. ΓöéwpScanSetupString   ΓöéParses the setup string specified when  Γöé
  14041. Γöé                    Γöéthe object is created.                  Γöé
  14042. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14043. ΓöéwpSetup             ΓöéChanges object characteristics and      Γöé
  14044. Γöé                    Γöébehaviors as specified in the setup     Γöé
  14045. Γöé                    Γöéstring.                                 Γöé
  14046. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14047. ΓöéwpUnInitData        ΓöéDe-allocates the object's instance data.Γöé
  14048. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14049.  
  14050. Classes can define KEYNAMES and values that affect the behavior of their 
  14051. objects.  KEYNAME values can be specified in a setup string when an object is 
  14052. created by calling WinCreateObject or when a change in the behavior of an 
  14053. existing object is required and initiated by calling WinSetObjectData.  Because 
  14054. KEYNAMES have default values, setup strings are not required for these calls. 
  14055.  
  14056. Every class defines its own set of KEYNAMES and values. KEYNAMES and the 
  14057. values supported by the WPObject class are listed in the following table. 
  14058.  
  14059. WPObject KEYNAMES and Values 
  14060.  
  14061. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14062. ΓöéKEYNAME                       ΓöéValue          ΓöéDescription                   Γöé
  14063. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14064. ΓöéTITLE                         ΓöéTitle          ΓöéSets the object's title.      Γöé
  14065. Γöé                              Γöé               ΓöéEquivalent to calling the     Γöé
  14066. Γöé                              Γöé               ΓöéwpSetTitle method.            Γöé
  14067. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14068. ΓöéICONFILE                      Γöéfilename       ΓöéSets the object's icon.       Γöé
  14069. Γöé                              Γöé               ΓöéEquivalent to calling the     Γöé
  14070. Γöé                              Γöé               ΓöéwpSetIconData method.         Γöé
  14071. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14072. ΓöéHELPPANEL                     Γöéid             ΓöéSets the object's default helpΓöé
  14073. Γöé                              Γöé               Γöépanel.  Equivalent to calling Γöé
  14074. Γöé                              Γöé               Γöéthe wpSetDefaultHelp method.  Γöé
  14075. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14076. ΓöéTEMPLATE                      ΓöéYES            ΓöéUser can create object        Γöé
  14077. Γöé                              Γöé               Γöétemplate. Equivalent to       Γöé
  14078. Γöé                              Γöé               Γöécalling wpSetStyle method withΓöé
  14079. Γöé                              Γöé               ΓöéOBJSTYLE_TEMPLATE style.      Γöé
  14080. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14081. Γöé                              ΓöéNO             ΓöéUser cannot create object     Γöé
  14082. Γöé                              Γöé               Γöétemplate.                     Γöé
  14083. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14084. ΓöéNODELETE                      ΓöéYES            ΓöéUser cannot delete object.    Γöé
  14085. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14086. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14087. Γöé                              Γöé               ΓöéOBJSTYLE_NODELETE style.      Γöé
  14088. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14089. Γöé                              ΓöéNO             ΓöéUser can delete object.       Γöé
  14090. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14091. ΓöéNOCOPY                        ΓöéYES            ΓöéUser cannot copy object.      Γöé
  14092. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14093. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14094. Γöé                              Γöé               ΓöéOBJSTYLE_NOCOPY style.        Γöé
  14095. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14096. Γöé                              ΓöéNO             ΓöéUser can copy object.         Γöé
  14097. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14098. ΓöéNOMOVE                        ΓöéYES            ΓöéUser cannot move object.      Γöé
  14099. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14100. Γöé                              Γöé               ΓöéwpSetStyle method  with       Γöé
  14101. Γöé                              Γöé               ΓöéOBJSTYLE_NOMOVE style.        Γöé
  14102. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14103. Γöé                              ΓöéNO             ΓöéUser can move object.         Γöé
  14104. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14105. ΓöéNOSHADOW                      ΓöéYES            ΓöéUser cannot create shadow of  Γöé
  14106. Γöé                              Γöé               Γöéobject.  Equivalent to callingΓöé
  14107. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14108. Γöé                              Γöé               ΓöéOBJSTYLE_NOSHADOW style.      Γöé
  14109. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14110. Γöé                              ΓöéNO             ΓöéUser can create shadow of     Γöé
  14111. Γöé                              Γöé               Γöéobject.                       Γöé
  14112. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14113. ΓöéNOTVISIBLE                    ΓöéYES            ΓöéObject is not visible.        Γöé
  14114. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14115. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14116. Γöé                              Γöé               ΓöéOBJSTYLE_NOTVISIBLE style.    Γöé
  14117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14118. Γöé                              ΓöéNO             ΓöéObject is visible.            Γöé
  14119. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14120. ΓöéNOPRINT                       ΓöéYES            ΓöéUser cannot print object.     Γöé
  14121. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14122. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14123. Γöé                              Γöé               ΓöéOBJSTYLE_NOPRINT style.       Γöé
  14124. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14125. Γöé                              ΓöéNO             ΓöéUser can print object.        Γöé
  14126. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14127. ΓöéICONRESOURCE                  Γöéid,module      ΓöéSets the object's icon.       Γöé
  14128. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14129. Γöé                              Γöé               ΓöéwpSetIconData method.  The    Γöé
  14130. Γöé                              Γöé               Γöé"id" is the icon resource ID  Γöé
  14131. Γöé                              Γöé               Γöéin the dynamic link library   Γöé
  14132. Γöé                              Γöé               Γöé(DLL) "module."               Γöé
  14133. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14134. ΓöéICONPOS                       Γöéx,y            ΓöéSets the object's initial iconΓöé
  14135. Γöé                              Γöé               Γöéposition in a folder.  The x  Γöé
  14136. Γöé                              Γöé               Γöéand y values represent the    Γöé
  14137. Γöé                              Γöé               Γöéposition in the folder in     Γöé
  14138. Γöé                              Γöé               Γöépercentage coordinates.       Γöé
  14139. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14140. ΓöéOBJECTID                      Γöé<name>         ΓöéSets a persistent ID for the  Γöé
  14141. Γöé                              Γöé               Γöéobject.  The OBJECTID can be  Γöé
  14142. Γöé                              Γöé               Γöéused to obtain a pointer or   Γöé
  14143. Γöé                              Γöé               Γöéhandle to the object by       Γöé
  14144. Γöé                              Γöé               Γöécalling the wpclsQueryObject  Γöé
  14145. Γöé                              Γöé               Γöémethod or WinQueryObject      Γöé
  14146. Γöé                              Γöé               Γöéfunction.  An OBJECTID is any Γöé
  14147. Γöé                              Γöé               Γöéunique string preceded with a Γöé
  14148. Γöé                              Γöé               Γöé`<' and terminated with a `>.'Γöé
  14149. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14150. ΓöéNORENAME                      ΓöéYES            ΓöéUser cannot rename object.    Γöé
  14151. Γöé                              Γöé               ΓöéEquivalent to calling the     Γöé
  14152. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14153. Γöé                              Γöé               ΓöéOBJSTAYLE_NORENAME style.     Γöé
  14154. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14155. Γöé                              ΓöéNO             ΓöéUser can rename object.       Γöé
  14156. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14157. ΓöéNODRAG                        ΓöéYES            ΓöéUser cannot drag object.      Γöé
  14158. Γöé                              Γöé               ΓöéEquivalent to calling         Γöé
  14159. Γöé                              Γöé               ΓöéwpSetStyle method with        Γöé
  14160. Γöé                              Γöé               ΓöéOBJSTYLE_NODRAG style.        Γöé
  14161. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14162. Γöé                              ΓöéNO             ΓöéUser can drag object.         Γöé
  14163. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14164. ΓöéVIEWBUTTON                    ΓöéHIDE           ΓöéViews of object have a hide   Γöé
  14165. Γöé                              Γöé               Γöébutton instead of a minimize  Γöé
  14166. Γöé                              Γöé               Γöébutton.                       Γöé
  14167. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14168. Γöé                              ΓöéMINIMIZE       ΓöéViews of object have a        Γöé
  14169. Γöé                              Γöé               Γöéminimize button instead of    Γöé
  14170. Γöé                              Γöé               Γöéhide button.                  Γöé
  14171. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14172. ΓöéMINWIN                        ΓöéHIDE           ΓöéViews of object are hidden    Γöé
  14173. Γöé                              Γöé               Γöéwhen minimize button is       Γöé
  14174. Γöé                              Γöé               Γöéselected.                     Γöé
  14175. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14176. Γöé                              ΓöéVIEWER         ΓöéViews of object minimized to  Γöé
  14177. Γöé                              Γöé               Γöéminimized window viewer when  Γöé
  14178. Γöé                              Γöé               Γöéminimize button selected.     Γöé
  14179. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14180. Γöé                              ΓöéDESKTOP        ΓöéViews of object minimized to  Γöé
  14181. Γöé                              Γöé               ΓöéDesktop when minimize button  Γöé
  14182. Γöé                              Γöé               Γöéselected.                     Γöé
  14183. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14184. ΓöéCONCURRENTVIEW                ΓöéYES            ΓöéNew views of object created   Γöé
  14185. Γöé                              Γöé               Γöéevery time user selects open. Γöé
  14186. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14187. Γöé                              ΓöéNO             ΓöéOpen views of object resurfaceΓöé
  14188. Γöé                              Γöé               Γöéwhen user selects open.       Γöé
  14189. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14190. ΓöéOPEN                          ΓöéSETTINGS       ΓöéOpens settings view when      Γöé
  14191. Γöé                              Γöé               Γöéobject is created or when     Γöé
  14192. Γöé                              Γöé               ΓöéWinSetObjectData is called.   Γöé
  14193. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14194. Γöé                              ΓöéDEFAULT        ΓöéOpens default view when objectΓöé
  14195. Γöé                              Γöé               Γöéis created or when            Γöé
  14196. Γöé                              Γöé               ΓöéWinSetObjectData is called.   Γöé
  14197. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14198.  
  14199. KEYNAMES and their values are specified in a setup string as shown in the 
  14200. following figure. 
  14201.  
  14202.   pszSetupString="TITLE=MYObject;ICONFILE=MYOBJ.ICO;OBJECTID=<MyObjectID>";
  14203.  
  14204. Example of Object Setup String 
  14205.  
  14206. KEYNAMES and their values are separated by semicolons in the setup string.  The 
  14207. escape character (^) followed by a comma or semicolon can be used to represent 
  14208. a comma or semicolon if they are required in a KEYNAME value specification. 
  14209. KEYNAMES are processed by an object's wpSetup method, which is called when 
  14210. WinCreateObject and WinSetObjectData are called by an application. Classes that 
  14211. define their own KEYNAMES override the wpSetup method, as shown in the 
  14212. following figure. The override for wpSetup scans the setup string for its 
  14213. KEYNAMES and processes them. 
  14214.  
  14215.    wpSetup
  14216.  
  14217.        if (_wpScanSetupString("ICONFILE"...)
  14218.           _wpSetIconData();
  14219.        if (_wpScanSetupString("MYKEYNAME"..)
  14220.           do whatever;
  14221.  
  14222. Processing KEYNAMES for a Class 
  14223.  
  14224. Because wpSetup is called as a result of WinCreateObject and WinSetObjectData, 
  14225. applications can effect changes to objects that already exist on the Desktop 
  14226. and are being used. For example, to effect changes to the icons for objects 
  14227. that already exist, an application calls: 
  14228.  
  14229.  1. WinQueryObject to get a handle to the object using the object's OBJECTID. 
  14230.  
  14231.  2. WinSetObjectData with a ICONDATA KEYNAME value specified in the setup 
  14232.     string. 
  14233.  
  14234.  
  14235. ΓòÉΓòÉΓòÉ 8.3.1.7.1. The WPAbstract Class:  Persistent Objects ΓòÉΓòÉΓòÉ
  14236.  
  14237. By definition, WPAbstract and WPFileSystem objects are persistent objects. 
  14238. Because the the class examples used in this discussion are derived from the 
  14239. WPAbstract class, consider the characteristics of WPAbstract objects. 
  14240.  
  14241. WPAbstract objects are identified by a numeric handle.  Persistent objects need 
  14242. to keep track of where instances are, their attributes, and instance data. 
  14243. These requirements are reflected in the method overrides defined for this 
  14244. class.  There are no new methods for the WPAbstract class.  However, the 
  14245. WPAbstract class overrides some of the methods inherited from WPObject; methods 
  14246. that act on instance attributes, data and object state information. These 
  14247. include: 
  14248.  
  14249. o wpCopyObject 
  14250. o wpQueryTitle 
  14251. o wpQueryIcon 
  14252. o wpSetup 
  14253. o wpSaveImmediate 
  14254. o wpSaveState 
  14255. o wpRestoreState 
  14256. o wpMoveObject 
  14257. o wpQueryIconData 
  14258. o wpSetIconData 
  14259.  
  14260.  
  14261. ΓòÉΓòÉΓòÉ 8.3.1.8. Workplace Class Methods:  Implied Metaclasses ΓòÉΓòÉΓòÉ
  14262.  
  14263. All Workplace objects have implied metaclasses. This means that the object's 
  14264. metaclass is defined in the same file as the object's class.  A separate class 
  14265. definition file is not required for Workplace metaclasses, which is the primary 
  14266. advantage of implied metaclasses.  The number of files required to build an 
  14267. object is reduced. 
  14268.  
  14269. Metaclasses define all the class methods for a class.  Class methods act on 
  14270. class data common to all object instances of the class.  Metaclasses, 
  14271. therefore, are the mechanisms for defining class properties, as opposed to 
  14272. instance properties.  Workplace class properties include the default attributes 
  14273. for all instances of the class, for example, the default object title, default 
  14274. help panel, default icon, and so forth. 
  14275.  
  14276. Workplace class methods are prefixed by wpcls.  Some of the class methods 
  14277. defined by the WPObject class are shown in the following table. 
  14278.  
  14279. Some WPObject Class Methods 
  14280.  
  14281. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14282. ΓöéMethod                  ΓöéDescription                         Γöé
  14283. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14284. ΓöéwpclsFindObjectEnd      ΓöéEnds a search for an object         Γöé
  14285. Γöé                        Γöébelonging to the class.             Γöé
  14286. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14287. ΓöéwpclsFindObjectFirst    ΓöéBegins a search for an object       Γöé
  14288. Γöé                        Γöébelonging to the class.             Γöé
  14289. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14290. ΓöéwpclsFindObjectNext     ΓöéFinds another object belonging to   Γöé
  14291. Γöé                        Γöéthe class.                          Γöé
  14292. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14293. ΓöéwpclsQueryDefaultHelp   ΓöéGets the default help panel for     Γöé
  14294. Γöé                        Γöéinstances of the class.             Γöé
  14295. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14296. ΓöéwpclsQueryDefaultView   ΓöéGets the default open view for      Γöé
  14297. Γöé                        Γöéinstances of the class.             Γöé
  14298. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14299. ΓöéwpclsQueryDetails       ΓöéGets the default details view items Γöé
  14300. Γöé                        Γöéfor instances of the class.         Γöé
  14301. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14302. ΓöéwpclsQueryDetailsInfo   ΓöéGets and sets details information   Γöé
  14303. Γöé                        Γöéfor instances of the class.         Γöé
  14304. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14305. ΓöéwpclsQueryIcon          ΓöéGets the default icon for instances Γöé
  14306. Γöé                        Γöéof the class.                       Γöé
  14307. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14308. ΓöéwpclsQueryIconData      ΓöéGets and sets the default icon data Γöé
  14309. Γöé                        Γöéfor instances of the class.         Γöé
  14310. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14311. ΓöéwpclsQueryObject        ΓöéGets the pointer or handle to a     Γöé
  14312. Γöé                        Γöépersistent object.                  Γöé
  14313. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14314. ΓöéwpclsQueryStyle         ΓöéGets the default object style for   Γöé
  14315. Γöé                        Γöéinstances of the class.             Γöé
  14316. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14317. ΓöéwpclsQueryTitle         ΓöéGets the default title for instancesΓöé
  14318. Γöé                        Γöéof the class.                       Γöé
  14319. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14320.  
  14321. Default class characteristics are inherited by instances of the class unless 
  14322. the class overrides the methods that operate on those characteristics. For 
  14323. example,  to define a default object style for instances of MyObject,  MyObject 
  14324. overrides wpclsQueryStyle and returns the appropriate default class style. 
  14325. Default class styles for objects belonging to a class are shown in the 
  14326. following table. 
  14327.  
  14328. Default Class Styles for Objects 
  14329.  
  14330. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14331. ΓöéStyle                         ΓöéDescription                   Γöé
  14332. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14333. ΓöéCLSSTYLE_NEVERMOVE            ΓöéUser cannot move object.      Γöé
  14334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14335. ΓöéCLSSTYLE_NEVERSHADOW          ΓöéUser cannot create shadow for Γöé
  14336. Γöé                              Γöéobject.                       Γöé
  14337. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14338. ΓöéCLSSTYLE_NEVERCOPY            ΓöéUser cannot copy object.      Γöé
  14339. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14340. ΓöéCLSSTYLE_NEVERTEMPLATE        ΓöéUser cannot create template   Γöé
  14341. Γöé                              Γöéfor object.                   Γöé
  14342. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14343. ΓöéCLSSTYLE_NEVERDELETE          ΓöéUser cannot delete object.    Γöé
  14344. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14345. ΓöéCLSSTYLE_NEVERPRINT           ΓöéUser cannot print object.     Γöé
  14346. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14347. ΓöéCLSSTYLE_NEVERDRAG            ΓöéUser cannot drag object.      Γöé
  14348. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14349. ΓöéCLSSTYLE_NEVERVISIBLE         ΓöéObject instances are always   Γöé
  14350. Γöé                              Γöéinvisible.                    Γöé
  14351. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14352. ΓöéCLSSTYLE_NEVERRENAME          ΓöéUser cannot rename object.    Γöé
  14353. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14354.  
  14355. The FindObject class methods (wpclsFindObjectFirst, wpclsFindObjectNext, and 
  14356. wpclsFindObjectEnd) are similar in function to the DosFind functions in the 
  14357. OS/2 file system.  The wpclsFindObjectFirst method initiates the search for 
  14358. objects belonging to the class with the specified characteristics.  The 
  14359. wpclsFindObjectEnd method ends the search. Typically they are overridden when a 
  14360. more robust FindObject function is required or when the user initiates a search 
  14361. for an object. 
  14362.  
  14363.  
  14364. ΓòÉΓòÉΓòÉ 8.3.2. Creating a Workplace Object:  The Car Object ΓòÉΓòÉΓòÉ
  14365.  
  14366. Many of the things previously discussed are demonstrated in the CAR Sample 
  14367. Workplace Object included in the Toolkit.  CAR is a spin-off implementation of 
  14368. the car object example used in the Systems Application Architecture:  Common 
  14369. User Access Guide to User Interface Design and highlighted in the first part of 
  14370. this chapter. 
  14371.  
  14372. The CAR object has two views: 
  14373.  
  14374. o An "Open car" view, which is a representation of a car that moves randomly 
  14375.   around a window. 
  14376.  
  14377. o A "Settings" view or Settings Notebook that permits the user to change the 
  14378.   sound of the horn (on the "Horn Beep" page) and the speed of the car (on the 
  14379.   "Dashboard" page). 
  14380.  
  14381. The "Horn Beep" and "Dashboard" pages in the CAR's Settings Notebook are dialog 
  14382. windows whose contents are defined in a dialog template in the CAR.RC resource 
  14383. file.  The resources are appended to the binary CAR.DLL file.  The help panels 
  14384. associated with the dialogs are defined in the CAR.HLP help library.  The 
  14385. association between the help panels and the dialogs is established with the 
  14386. dialog template in the resource file. 
  14387.  
  14388. CAR is a persistent object but not a part of the file system.  Therefore, it is 
  14389. derived from the WPAbstract class, which is derived from the WPObject root 
  14390. Workplace class.  This means that CAR inherits the methods from WPAbstract, 
  14391. which in turn inherits all, and overrides some, of the instance and class 
  14392. methods from WPObject. 
  14393.  
  14394. CAR defines new methods and overrides some instance and class methods inherited 
  14395. from both WPAbstract and WPObject.  New methods defined for the CAR class are 
  14396. summarized in the following table. 
  14397.  
  14398. New Methods for CAR Class 
  14399.  
  14400. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14401. ΓöéMethod              ΓöéDescription                             Γöé
  14402. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14403. ΓöécarSetInfo          ΓöéSets up the car information.  It is     Γöé
  14404. Γöé                    Γöécalled by the dialog procedure to updateΓöé
  14405. Γöé                    Γöéthe car data as the user interacts with Γöé
  14406. Γöé                    Γöéthe dialog window.                      Γöé
  14407. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14408. ΓöécarQueryInfo        ΓöéGets the car information.  It is called Γöé
  14409. Γöé                    Γöéby the dialog procedure to get the      Γöé
  14410. Γöé                    Γöélatest car data when the dialog window  Γöé
  14411. Γöé                    Γöéopened.                                 Γöé
  14412. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14413. ΓöéwpAddDashboardPage  ΓöéInserts the "Dashboard" page in the     Γöé
  14414. Γöé                    ΓöéSettings Notebook.  It is called by the Γöé
  14415. Γöé                    ΓöéwpAddSettingsPage method.               Γöé
  14416. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14417. ΓöéwpAddHornBeepPage   ΓöéInserts the "Horn Beep" page in the     Γöé
  14418. Γöé                    ΓöéSettings Notebook.  It is called by the Γöé
  14419. Γöé                    ΓöéwpAddSettingsPage method.               Γöé
  14420. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14421.  
  14422. The implementation of the CAR object consists primarily of overrides to 
  14423. instance and class methods inherited from the WPObject and WPAbstract classes: 
  14424.  
  14425. o Providing for Persistence of the CAR Object 
  14426.  
  14427.   Because the CAR class defines its own set of data, it overrides the 
  14428.   wpSaveState and wpRestoreState methods.  These method overrides, in turn, 
  14429.   call the wpSaveLong and wpRestoreLong methods to save instance data defined 
  14430.   for the CAR class. 
  14431.  
  14432. o Changing the Settings Notebook Pages 
  14433.  
  14434.   CAR creates Settings Notebook pages by overriding the wpAddSettingsPage 
  14435.   method inherited from WPObject.  The wpAddSettingsPage method calls the new 
  14436.   methods defined by the CAR class, wpAddDashboardPage and wpAddHornBeepPage. 
  14437.   In turn, each of these call the wpInsertSettingsPage method inherited from 
  14438.   WPObject. 
  14439.  
  14440. o Changing the Context Menu 
  14441.  
  14442.   Because the user action "Print a car" does not make sense for this object, 
  14443.   the CAR class removes the Print option from the CAR object's context menu by 
  14444.   overriding the wpFilterPopupMenu inherited from WPOject. 
  14445.  
  14446. o Adding an Action to the Context Menu 
  14447.  
  14448.   The CAR class adds a "Beep horn" action to its context menu by overriding the 
  14449.   wpModifyPopupMenu method inherited from WPObject.  The method override for 
  14450.   wpModifyPopupMenu calls the wpInsertPopupMenuItem, also inherited from 
  14451.   WPObject, to insert this item into CAR's context menu. 
  14452.  
  14453. o Adding an Item to the Open Menu 
  14454.  
  14455.   The CAR class adds an Open car view (OPEN_CAR) to its "Open" menu by 
  14456.   overriding its wpModifyPopupMenu method. The method override calls 
  14457.   wpInsertPopupMenuItem to insert Open car in the "Open" menu. 
  14458.  
  14459. o Creating and Registering a new Open View 
  14460.  
  14461.   A window for the OPEN_CAR view is created and opened by calling 
  14462.   WinCreateStdWindow.  The window procedure for the client of the OPEN_CAR 
  14463.   window registers the OPEN_CAR view and associates the OPEN_CAR view with that 
  14464.   window by calling the wpRegisterView method. 
  14465.  
  14466. o Processing New Menu Items on a Context or Pull-down Menu 
  14467.  
  14468.   When a class defines new actions for its menus, it must provide for the 
  14469.   processing of the actions when the user selects the action.  This is done by 
  14470.   overriding its wpMenuItemSelected method inherited from WPObject. Depending 
  14471.   on the action the user selects, the method override for wpMenuItemSelected 
  14472.   calls the object's wpOpen method to open the OPEN_CAR view or calls the 
  14473.   carBeepHorn method to beep the car's horn. 
  14474.  
  14475. o Processing Help for New Actions on Context Menu 
  14476.  
  14477.   When a class defines new actions for its context menu, it also must provide 
  14478.   for the processing of the HELP for those actions when the user requests it. 
  14479.   This is accomplished by overriding the wpMenuItemHelpSelected method 
  14480.   inherited from WPObject.  Given the action selected by the user, the method 
  14481.   override for wpMenuItemHelpSelected calls the wpDisplayHelp method inherited 
  14482.   from WPObject to display the help for that action.  wpDisplayHelp requires 
  14483.   the ID for the help panel associated with the action, as well as the name of 
  14484.   the help library where it resides. 
  14485.  
  14486. The implementation of the CAR object also demonstrates: 
  14487.  
  14488.  1. Use of a Release Order in CAR.CSC. 
  14489.  
  14490.  2. The use of external stem and prefix attributes in the Class section of 
  14491.     CAR.CSC.  Debugging is easier because method names are externalized. 
  14492.  
  14493.  3. Use of the message queue for the Shell.  Object code runs on the Shell's 
  14494.     thread. Windows associated with objects receive messages through the 
  14495.     Shell's message queue.  Objects do not need their own message queues. 
  14496.  
  14497.  
  14498. ΓòÉΓòÉΓòÉ 8.3.3. The Workplace Application Interface ΓòÉΓòÉΓòÉ
  14499.  
  14500. Outside the Workplace environment, objects are DLLs that consist of data and 
  14501. code that operates on that data when objects are instantiated in the Workplace 
  14502. (run-time) environment.  Workplace objects have no life outside the Workplace 
  14503. environment. 
  14504.  
  14505. Workplace classes come to life when the class is registered with the Workplace 
  14506. Shell and the class is instantiated.  The Workplace Shell and SOM provide the 
  14507. underlying code (predefined Workplace Object methods) that supports an object's 
  14508. existence.  The Shell calls the appropriate object methods when the user 
  14509. interacts with the object.  In this sense, the Shell is the client of all 
  14510. Workplace objects.  The Shell manipulates the object (its code) on behalf of 
  14511. its users. 
  14512.  
  14513. Applications, on the other hand, cannot call Workplace object methods directly. 
  14514. They are not clients of Workplace objects, in the same sense that applications 
  14515. can be clients of SOM objects.  Workplace objects are derived from the WPObject 
  14516. class, which is derived from the SOMObject class.  They share all the features 
  14517. of SOM objects: inheritance, polymorphism, and so forth.  But only the Shell 
  14518. can directly manipulate them. 
  14519.  
  14520. Because there are times when applications might need to effect changes to the 
  14521. Desktop and objects on the Desktop, the Workplace Shell provides functions that 
  14522. permit you to effect those changes.  These are summarized in the following 
  14523. table. 
  14524.  
  14525. Workplace API 
  14526.  
  14527. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14528. ΓöéFunction                ΓöéDescription                         Γöé
  14529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14530. ΓöéWinCreateObject         ΓöéCreates an object.                  Γöé
  14531. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14532. ΓöéWinDeregisterObjectClassΓöéDeregisters (removes) a Workplace   Γöé
  14533. Γöé                        Γöéobject class.                       Γöé
  14534. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14535. ΓöéWinDestroyObject        ΓöéDeletes a Workplace object.         Γöé
  14536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14537. ΓöéWinEnumObjectClasses    ΓöéGets a list of all Workplace classesΓöé
  14538. Γöé                        Γöéthat have been registered.          Γöé
  14539. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14540. ΓöéWinFreeIcon             ΓöéFrees pointer to icon allocated by  Γöé
  14541. Γöé                        ΓöéWinLoadFileIcon.                    Γöé
  14542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14543. ΓöéWinLoadFileIcon         ΓöéGets a pointer to an icon associatedΓöé
  14544. Γöé                        Γöéwith the specified icon file.       Γöé
  14545. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14546. ΓöéWinQueryObject          ΓöéGets a handle to a given object.    Γöé
  14547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14548. ΓöéWinRegisterObjectClass  ΓöéRegisters a Workplace object class. Γöé
  14549. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14550. ΓöéWinReplaceObjectClass   ΓöéReplaces a registered class with    Γöé
  14551. Γöé                        Γöéanother registered class.           Γöé
  14552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14553. ΓöéWinRestoreWindowPos     ΓöéRestores a window to the state it   Γöé
  14554. Γöé                        Γöéwas in when WinStoreWindowPos was   Γöé
  14555. Γöé                        Γöélast called for the same applicationΓöé
  14556. Γöé                        Γöéand keyname.                        Γöé
  14557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14558. ΓöéWinSetFileIcon          ΓöéSets the icon for a file.           Γöé
  14559. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14560. ΓöéWinSetObjectData        ΓöéChanges settings on an object that  Γöé
  14561. Γöé                        Γöéwas created with the WinCreateObjectΓöé
  14562. Γöé                        Γöéfunction.                           Γöé
  14563. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14564. ΓöéWinShutdownSystem       ΓöéCloses down the system.             Γöé
  14565. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14566. ΓöéWinStoreWindowPos       ΓöéSaves the current state of the      Γöé
  14567. Γöé                        Γöéspecified window.                   Γöé
  14568. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14569.  
  14570.  
  14571. ΓòÉΓòÉΓòÉ 8.3.3.1. Object Class Functions ΓòÉΓòÉΓòÉ
  14572.  
  14573. For the Shell to know how to manipulate objects on the user's behalf, it must 
  14574. know about the object class and the class definition, that is, its data and 
  14575. methods.  Object classes, therefore, must be registered with the Shell. 
  14576. WinEnumObjectClasses, WinRegisterObjectClass, WinDeRegisterObjectClass, and 
  14577. WinReplaceObjectClass enable applications to affect object classes registered 
  14578. with the Workplace Shell. WinEnumObjectClasses enables an application to get 
  14579. the list of all Workplace object classes that have been registered with the 
  14580. Shell. 
  14581.  
  14582. WinRegisterObjectClass and WinDeRegisterObjectClass permit an application to 
  14583. register and deregister Workplace object classes with the Shell. 
  14584. WinRegisterObjectClass registers the specified Workplace object class that is 
  14585. defined in the specified DLL module that was created using the SOM compiler. 
  14586. The name of the object class must match the library name specified in the DEF 
  14587. file used to build the DLL.  Because all registered classes are maintained in 
  14588. the OS2.INI file and are cached upon system initialization, a class should be 
  14589. removed if it is no longer needed. 
  14590.  
  14591. WinReplaceObjectClass can be used to replace an existing (registered) object 
  14592. class with another class.  The replacement class is a subclass of the class 
  14593. being replaced.  This type of class is useful for modifying the behavior of 
  14594. instances of a Workplace object class without the instances being aware of the 
  14595. new class.  WinReplaceObjectClass also can be used to undo the replacement and 
  14596. restore the original class that defines the behavior of its instances. 
  14597.  
  14598.  
  14599. ΓòÉΓòÉΓòÉ 8.3.3.2. Object Instance Functions ΓòÉΓòÉΓòÉ
  14600.  
  14601. Applications can create and destroy object instances of Workplace classes by 
  14602. calling WinCreateObject and WinDestroyObject.  To create an object, an 
  14603. application must specify the object's class name, title, setup information, and 
  14604. where it is to be placed on the Desktop. 
  14605.  
  14606. Each object class defines a set of KEYNAME or setup variables and values that 
  14607. can be used to control the attributes and behavior of its objects.  An object's 
  14608. setup information is processed by its wpSetup method inherited from WPObject. 
  14609. The object's wpSetup method is called when the object is created by 
  14610. WinCreateObject. Every Workplace class inherits the set of KEYNAMES defined for 
  14611. the WPObject class.  Every Workplace class can define additional KEYNAMES, 
  14612. unique to that class.  KEYNAMES defined by the Workplace objects provided with 
  14613. the Shell are shown in the following table. 
  14614.  
  14615. Newly-created objects need to be placed somewhere on the Desktop, either 
  14616. directly on the Desktop or in a folder.  All Workplace objects have object IDs 
  14617. associated with them.  As shown in the following table, predefined system 
  14618. folders have object IDs associated with them. When an object is created by 
  14619. WinCreateObject, an application can specify its location as one of the 
  14620. predefined system folders. 
  14621.  
  14622. Object IDs for Predefined System Folders 
  14623.  
  14624. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14625. ΓöéID                      ΓöéSystem Folder                       Γöé
  14626. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14627. Γöé<WP_NOWHERE>            ΓöéHidden folder                       Γöé
  14628. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14629. Γöé<WP_DESKTOP>            ΓöéDesktop                             Γöé
  14630. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14631. Γöé<WP_SYSTEM>             ΓöéSystem folder                       Γöé
  14632. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14633. Γöé<WP_TEMPS>              ΓöéTemplates folder                    Γöé
  14634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14635. Γöé<WP_CONFIG>             ΓöéSystem Setup folder                 Γöé
  14636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14637. Γöé<WP_START>              ΓöéStartup folder                      Γöé
  14638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14639. Γöé<WP_INFO>               ΓöéInformation folder                  Γöé
  14640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14641. Γöé<WP_DRIVE>              ΓöéDrives folder                       Γöé
  14642. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14643.  
  14644. WinCreateObject returns a handle to the newly created object.  This handle is 
  14645. persistent and can be used at any time to reference the object.  Applications 
  14646. that did not create the object can get a handle to the object by calling 
  14647. WinQueryObject.  WinQueryObject requires either a full path name for a file 
  14648. object or an objectID. 
  14649.  
  14650. Applications that can get a handle to an object can change the behavior or 
  14651. state of that object by calling WinSetObjectData.  This function results in the 
  14652. Workplace Shell calling the object's wpSetup method. By specifying a value for 
  14653. KEYNAME variables defined for the object's class, an application, therefore, 
  14654. can effect changes to objects that already exist on the Desktop.  The process 
  14655. of effecting changes to existing objects on the Desktop is summarized in the 
  14656. following figure. 
  14657.  
  14658.   WinQueryObject(...); /* use ObjectID to get handle to object            */
  14659.  
  14660.   pszSetupString="KEYNAME1=value;...";/*Put KEYNAME values in Setup String*/
  14661.  
  14662.   WinSetObjectData(...);    /*Change behavior of existing object          */
  14663.  
  14664. Changing Existing Objects on the Desktop 
  14665.  
  14666.  
  14667. ΓòÉΓòÉΓòÉ 8.3.4. REXX Utility Workplace Functions ΓòÉΓòÉΓòÉ
  14668.  
  14669. The REXX Language provides utility functions for Workplace classes and objects. 
  14670. These functions are listed in the following table. 
  14671.  
  14672. REXX Utility Workplace Functions 
  14673.  
  14674. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14675. ΓöéFunction                      ΓöéDescription                   Γöé
  14676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14677. ΓöéSysRegisterObjectClass        ΓöéRegisters a Workplace object  Γöé
  14678. Γöé                              Γöéclass.                        Γöé
  14679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14680. ΓöéSysDeregisterObjectClass      ΓöéDeregisters a Workplace objectΓöé
  14681. Γöé                              Γöéclass.                        Γöé
  14682. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14683. ΓöéSysQueryClassList             ΓöéGets the list of Workplace    Γöé
  14684. Γöé                              Γöéclasses registered with the   Γöé
  14685. Γöé                              ΓöéShell.                        Γöé
  14686. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14687. ΓöéSysCreateObject               ΓöéCreates a Workplace object.   Γöé
  14688. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14689.  
  14690. REXX utility functions permit users to write batch files to operate on 
  14691. Workplace classes and objects the same as applications.  For example, a simple 
  14692. REXX batch file, as shown in the following figure. can list all Workplace 
  14693. classes registered with the Shell. 
  14694.  
  14695.   /* Load the REXX utility functions                      */
  14696.   call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  14697.   call SysLoadFuncs
  14698.   /* List all Workplace classes registered with the Shell */
  14699.   call SysQueryClassList   "list."
  14700.   do i = 1 to list.0
  14701.     say 'Class' i 'is' list.i
  14702.   end
  14703.  
  14704. REXX Batch File to List all Classes Registered With Workplace 
  14705.  
  14706.  
  14707. ΓòÉΓòÉΓòÉ 8.3.5. Installing a Workplace Object ΓòÉΓòÉΓòÉ
  14708.  
  14709. Workplace objects can be installed on the Desktop in either of two ways: 
  14710.  
  14711. o By running an installation program or batch file 
  14712. o By using the Workplace Class List utility. 
  14713.  
  14714.  
  14715. ΓòÉΓòÉΓòÉ 8.3.5.1. Object Installation Programs ΓòÉΓòÉΓòÉ
  14716.  
  14717. Application developers can provide installation programs for their objects. 
  14718. From the user's perspective, installation consists of putting a diskette in the 
  14719. diskette drive, double-clicking on the diskette drive and then on the 
  14720. installation program. 
  14721.  
  14722. An installation program is responsible for: 
  14723.  
  14724. o Copying the DLL that contains the object's class definition from a diskette 
  14725.   to the \OS2\DLL directory or to a directory in the LIBPATH 
  14726.  
  14727. o Registering the class and its DLL name with the Shell by calling 
  14728.   WinRegisterObjectClass 
  14729.  
  14730. o Creating an object instance of the class and placing it on the Desktop or in 
  14731.   a particular folder by calling WinCreateObject. 
  14732.  
  14733. An example of an installation program for a Workplace object is shown in the 
  14734. following figure. 
  14735.  
  14736.  
  14737. Installation Program for Workplace Object
  14738.  
  14739. /*  Command-line program to install workplace objects         */
  14740.  
  14741. #define INCL_WINWORKPLACE
  14742. #include <os2.h>
  14743. #include <stdio.h>
  14744. #include <string.h>
  14745.  
  14746. #if defined(DEBUG)
  14747.    #define LOCATION_DESKTOP ((PSZ)"<WP_DESKTOP>")
  14748. #endif
  14749.  
  14750. /**************************************************************/
  14751. *  Main Function
  14752. *
  14753. *   argv[1] = Class Name
  14754. *   argv[2] = Module (DLL) Name
  14755. *   argv[3] = Object Title
  14756. *   argv[4] = Location
  14757. *   argv[5] = Setup String
  14758. *
  14759. ***************************************************************/
  14760.  
  14761. INT main (argc, argv)
  14762.    INT argc;
  14763.    CHAR *argv[];
  14764. {
  14765. HAB vhab;
  14766. HMQ vhmq;
  14767. BOOL fSuccess;
  14768.  
  14769.    if (argc == 1)
  14770.    {
  14771.       #if defined(DEBUG)
  14772.       {
  14773.          printf("Usage:\n\n");
  14774.          printf("   WPCREATE ClassName ModuleName Title [[Location]
  14775.                 [SetupString]]\n");
  14776.       }
  14777.       #endif
  14778.       return (0);
  14779.    }   /* end if (argc == 1) */
  14780.  
  14781.    if (argc < 4) return (1);        /* first three parms are mandatory */
  14782.  
  14783.    /*   Register the class             */
  14784.  
  14785.    #if defined(DEBUG)
  14786.       printf("WinRegisterObjectClass(%s, %s)...\n", argv[1], argv[2]);
  14787.    #endif
  14788.  
  14789.    fSuccess =
  14790.    WinRegisterObjectClass(
  14791.       argv[1],                            /* Class name (case sensitive) */
  14792.       argv[2]);                                           /* module name */
  14793.  
  14794.    if (!fSuccess)         return (1);       /* return non-zero for error */
  14795.  
  14796.    #if defined(DEBUG)
  14797.       printf("Success: rc = %u\n", fSuccess);
  14798.    #endif
  14799.  
  14800.    /*   Create an instance of the object     */
  14801.  
  14802.    #if defined(DEBUG)
  14803.       printf("WinCreateObject(%s, %s,...)...\n", argv[1], argv[3]);
  14804.    #endif
  14805.    fSuccess =
  14806.    WinCreateObject(
  14807.       argv[1],                                             /* class name */
  14808.       argv[3],                                    /* object name (Title) */
  14809.       argc > 5 ? argv[5] : " ",                          /* setup string */
  14810.       argc > 4 ? argv[4] : LOCATION_DESKTOP,                 /* location */
  14811.       CO_FAILIFEXISTS);                                         /* flags */
  14812.    if (!fSuccess)  return (1);              /* return non-zero for error */
  14813.  
  14814.    #if defined(DEBUG)
  14815.       printf("Success: rc = %u\n", fSuccess);
  14816.    #endif
  14817.  
  14818.    return(0);
  14819.  
  14820. }   /* end main() */
  14821.  
  14822. Instantiating an object is an optional responsibility for an installation 
  14823. program. When a class is registered by calling WinRegisterObjectClass, an 
  14824. object template is placed in the Templates Folder on the Desktop, if the class 
  14825. supports templating. Users can create instances of these objects by tearing off 
  14826. a copy of the template.  This can be useful for larger applications that define 
  14827. data file objects that are associated with program objects. 
  14828.  
  14829.  
  14830. ΓòÉΓòÉΓòÉ 8.3.5.2. Object Installation Batch Files ΓòÉΓòÉΓòÉ
  14831.  
  14832. An installation batch file written in the REXX language performs the same 
  14833. operations, but uses the REXX-language utility functions 
  14834. SysRegisterObjectClass, SysCreateObject, SysDeRegisterObjectClass instead of 
  14835. the WinRegisterObjectClass, WinCreateObject and WinDeRegisterObjectClass 
  14836. Workplace functions. An example of an installation batch file written using the 
  14837. REXX-language utility functions is shown in the following figure. For more 
  14838. information, see Procedures Language 2/REXX Reference in the OS/2 2.0 Technical 
  14839. Library. 
  14840.  
  14841.   /* Register a Workplace class and create an instance     */
  14842.  
  14843.   /* Load the REXX utility functions                       */
  14844.   call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  14845.   call SysLoadFuncs
  14846.  
  14847.   /* Register class with Shell                             */
  14848.   if SysRegisterObjectClass("NewObjectClass", "NEWDLL") then
  14849.      say 'Class Registration successfully completed for NewObject'
  14850.  
  14851.   /* Create instance of object                            */
  14852.   if SysCreateObject("NewObjectClass","A New Object",
  14853.                     "<WP_Desktop>", "OBJECTID=<A New Object>") then
  14854.      say 'A New Object successfully created and placed on Desktop'
  14855.  
  14856. REXX Batch File for Installing Workplace Objects 
  14857.  
  14858.  
  14859. ΓòÉΓòÉΓòÉ 8.3.5.3. The Workplace Class List Object ΓòÉΓòÉΓòÉ
  14860.  
  14861. The Toolkit provides a Workplace Class List Object that is automatically 
  14862. installed during installation of the Toolkit.  This object is a tool that 
  14863. provides a windowed user interface for general Workplace class registration and 
  14864. object creation activities. It performs all the functions that a typical 
  14865. Workplace object installation program must provide, with the exception of 
  14866. copying files from an installation diskette to a hard disk.  It is a fast and 
  14867. easy way to build and test objects in an application development environment. 
  14868. It is not a tool for the general OS/2 user, who knows nothing about Workplace 
  14869. classes but only about Workplace objects. 
  14870.  
  14871. The Workplace Class List Object displays a hierarchical list of all classes 
  14872. registered with the Shell.  The user can add a class to this list or perform a 
  14873. number of actions on a specific class in the list.  The user can create an 
  14874. instance of the class, replace and unreplace the class, and delete the class. 
  14875.  
  14876. The Workplace Class List uses WinEnumObjectClasses to get the list of all 
  14877. classes registered with the Shell.  WinEnumObjectClasses returns only the name 
  14878. of the class and the DLL module that contains the class definition. It does not 
  14879. return information on the class ancestry that can be used to construct a 
  14880. hierarchical list of classes.  Because the Workplace Class List is a Workplace 
  14881. object, however, it can call the somParent function to determine parentage of 
  14882. each class and use this information to construct the list. 
  14883.  
  14884. The Workplace Class List uses the WinRegisterObjectClass, 
  14885. WinDeregisterObjectClass, WinReplaceObjectClass, and WinCreateObject functions 
  14886. to register, deregister, and replace object classes and to create objects. 
  14887.  
  14888. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14889. ΓöéUsage Note:  This tool can be used to delete any Workplace  Γöé
  14890. Γöéclass other than the predefined Workplace classes provided  Γöé
  14891. Γöéwith OS/2 2.0.  Its users should understand Workplace       Γöé
  14892. Γöéclasses and how they are defined so that they can be        Γöé
  14893. Γöérecovered.  Because the general user may not have this levelΓöé
  14894. Γöéof understanding, application developers should not         Γöé
  14895. Γöédistribute this tool with their objects to their customers. Γöé
  14896. ΓöéThe recommended way of delivering objects to customers is   Γöé
  14897. Γöéthrough installation programs or batch files.               Γöé
  14898. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14899.  
  14900.  
  14901. ΓòÉΓòÉΓòÉ 8.3.6. Programming Considerations for the Workplace ΓòÉΓòÉΓòÉ
  14902.  
  14903. Applications developers should be aware of the following items with respect to 
  14904. the Workplace. 
  14905.  
  14906.  
  14907. ΓòÉΓòÉΓòÉ 8.3.6.1. Extended Attributes and the Workplace ΓòÉΓòÉΓòÉ
  14908.  
  14909. Applications not written for the Workplace need to be aware of how .LONGNAME 
  14910. and  .ASSOCTABLE extended attributes are used by the Workplace. 
  14911.  
  14912. In the Workplace,  the user can edit the name of an object.  When an object is 
  14913. a file system object, the Workplace renames the file object to match the name 
  14914. the user has entered.  When the file system object resides on an HPFS disk, the 
  14915. new file name can have a long name and can accommodate whatever the user has 
  14916. entered.  When the file system object resides on a FAT disk, the new file name 
  14917. must be no longer than eight characters.  If the user has entered a name longer 
  14918. than eight characters, the Workplace uses the first eight characters to rename 
  14919. the object and places the remaining characters in a .LONGNAME extended 
  14920. attribute associated with the file system object.  This means that the title of 
  14921. a file object is the .LONGNAME extended attribute or the file name if no 
  14922. .LONGNAME exists. 
  14923.  
  14924. An .ASSOCTABLE extended attribute contains information that associates data 
  14925. files with the applications that create them or that know how to use them. 
  14926. Applications that a data file has been associated with appear in the list of 
  14927. Open actions for the data file.  This means that opening the file is equivalent 
  14928. to starting the application that creates or modifies that file. The application 
  14929. is passed the name of the file as a command-line parameter. 
  14930.  
  14931. .ASSOCTABLE extended attributes are defined in an application's resource file 
  14932. as shown in the following figure. 
  14933.  
  14934.   ASSOCTABLE
  14935.   BEGIN
  14936.     [file type], [file extension], [flags], [icon file name]
  14937.   END
  14938.  
  14939. .ASSOCTABLE Extended Attributes 
  14940.  
  14941. When an application that defines an .ASSOCTABLE is installed in the Workplace, 
  14942. the Shell automatically creates object templates for each type of data file 
  14943. that has been associated with the application. 
  14944.  
  14945. For more information on extended attributes, see the OS/2 Programming Guide, 
  14946. Volume I in the OS/2 2.0 Technical Library. 
  14947.  
  14948.  
  14949. ΓòÉΓòÉΓòÉ 8.3.6.2. Printing in the Workplace Shell ΓòÉΓòÉΓòÉ
  14950.  
  14951. To support printing the contents of an object from the Desktop-by using the 
  14952. object's pop-up menus or dragging the object and dropping it on the printer 
  14953. object-the object's class definition must override the wpPrintObject method 
  14954. that is inherited from its parent class. 
  14955.  
  14956. The new class is created as a subclass of an existing class. For example, if 
  14957. the object is to be a data file, the wpDataFile class would be used as the 
  14958. parent class. In the class definition file, the new class overrides the 
  14959. wpPrintObject method that it inherits from its parent class. The new class's 
  14960. version of wpPrintObject contains the code that prints the contents of the 
  14961. object. 
  14962.  
  14963. Note:  It is recommended that the code in the object's version of wpPrintObject 
  14964.        start a separate thread to execute the code that actually prints the 
  14965.        contents of the object. By doing the printing in a separate thread, 
  14966.        control can be returned to the Shell and the user immediately. 
  14967.        Supporting code, such as dialog windows, should be in the separate 
  14968.        thread as well. 
  14969.  
  14970. If this object class is to recognize files that already exist, override the 
  14971. wpclsQueryInstanceType and the wpclsQueryInstanceFilter class methods to check 
  14972. for appropriate .TYPE EAs or file extensions. 
  14973.  
  14974.  
  14975. ΓòÉΓòÉΓòÉ 8.4. Summary ΓòÉΓòÉΓòÉ
  14976.  
  14977. Summary of Workplace Terms 
  14978.  
  14979. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14980. ΓöéTerm                ΓöéDescription                             Γöé
  14981. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14982. ΓöéConditional cascadedΓöéA pull-down menu associated with an itemΓöé
  14983. Γöémenu                Γöéthat has a cascade mini-push button     Γöé
  14984. Γöé                    Γöébeside it in an object's pop-up menu.   Γöé
  14985. Γöé                    ΓöéThe pull-down menu is displayed when theΓöé
  14986. Γöé                    Γöéuser selects the mini-push button.      Γöé
  14987. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14988. ΓöéClass               ΓöéA general description of an object.     Γöé
  14989. Γöé                    ΓöéClasses define data that represents the Γöé
  14990. Γöé                    Γöéstate of an object and methods that     Γöé
  14991. Γöé                    Γöédefine the object's behavior and change Γöé
  14992. Γöé                    Γöéthe state of the object.                Γöé
  14993. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14994. ΓöéDirect manipulation ΓöéThe user's ability to interact with an  Γöé
  14995. Γöé                    Γöéobject by using the mouse, typically by Γöé
  14996. Γöé                    Γöédragging an object around on the DesktopΓöé
  14997. Γöé                    Γöéand dropping it on other objects.       Γöé
  14998. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14999. ΓöéEncapsulation       ΓöéHiding an object's implementation, that Γöé
  15000. Γöé                    Γöéis, its private, internal data and      Γöé
  15001. Γöé                    Γöémethods. Private variables and methods  Γöé
  15002. Γöé                    Γöéare accessible only to the object that  Γöé
  15003. Γöé                    Γöécontains them.                          Γöé
  15004. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15005. ΓöéExtended attribute  ΓöéContains information about a file       Γöé
  15006. Γöé                    Γöéobject. The information contained in EAsΓöé
  15007. Γöé                    Γöéis more comprehensive and varied than   Γöé
  15008. Γöé                    Γöéthe information displayed by the DIR    Γöé
  15009. Γöé                    Γöécommand.  EAs are not part of the file  Γöé
  15010. Γöé                    Γöéobject and are maintained by the file   Γöé
  15011. Γöé                    Γöésystem                                  Γöé
  15012. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15013. ΓöéHierarchical        ΓöéThe relationship between parent and     Γöé
  15014. Γöéinheritance         Γöéchild classes. Inheritance between      Γöé
  15015. Γöé                    Γöéobjects is hierarchical. An object that Γöé
  15016. Γöé                    Γöéis lower in the inheritance hierarchy   Γöé
  15017. Γöé                    Γöéthan another object (that is, a child   Γöé
  15018. Γöé                    Γöéobject of a parent or ancestor object)  Γöé
  15019. Γöé                    Γöéinherits all the characteristics and    Γöé
  15020. Γöé                    Γöébehaviors of the objects above it in theΓöé
  15021. Γöé                    Γöéhierarchy (ancestor objects).           Γöé
  15022. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15023. ΓöéInheritance         ΓöéThe derivation of new (child) classes   Γöé
  15024. Γöé                    Γöéfrom existing (parent) classes.  The newΓöé
  15025. Γöé                    Γöéclass inherits all the data and methods Γöé
  15026. Γöé                    Γöéof the parent class without having to   Γöé
  15027. Γöé                    Γöéredefine them.                          Γöé
  15028. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15029. ΓöéMetaclass           ΓöéDefines class methods and class         Γöé
  15030. Γöé                    Γöéproperties for the class of a class.    Γöé
  15031. Γöé                    ΓöéClass methods act on class data common  Γöé
  15032. Γöé                    Γöéto all object instances of the class.   Γöé
  15033. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15034. ΓöéMethod              ΓöéA function that defines a behavior for aΓöé
  15035. Γöé                    Γöéclass or object.                        Γöé
  15036. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15037. ΓöéObject              ΓöéA specific instance, or instantiation,  Γöé
  15038. Γöé                    Γöéof a class. Objects have associated     Γöé
  15039. Γöé                    Γöédata, called the object's state, and a  Γöé
  15040. Γöé                    Γöéset of behaviors, called the object's   Γöé
  15041. Γöé                    Γöémethods.                                Γöé
  15042. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15043. ΓöéPolymorphism        ΓöéThe ability to have different           Γöé
  15044. Γöé                    Γöéimplementations of the same method for  Γöé
  15045. Γöé                    Γöétwo or more classes of objects.         Γöé
  15046. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15047. ΓöéPop-up menu         ΓöéA menu that lists the actions that a    Γöé
  15048. Γöé                    Γöéuser can perform on an object. The      Γöé
  15049. Γöé                    Γöécontents of the pop-up menu can vary    Γöé
  15050. Γöé                    Γöédepending on the context, or state, of  Γöé
  15051. Γöé                    Γöéthe object.                             Γöé
  15052. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15053. ΓöéPersistent object   ΓöéAn object whose instance data and state Γöé
  15054. Γöé                    Γöéare preserved between system shutdown   Γöé
  15055. Γöé                    Γöéand system startup.                     Γöé
  15056. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15057. ΓöéSettings Notebook   ΓöéA control window used to display the    Γöé
  15058. Γöé                    Γöésettings for an object and to enable theΓöé
  15059. Γöé                    Γöéuser to change them.                    Γöé
  15060. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15061. ΓöéShadow              ΓöéAn object that refers to another        Γöé
  15062. Γöé                    Γöéobject's data. A shadow is not a copy ofΓöé
  15063. Γöé                    Γöéanother object but is another           Γöé
  15064. Γöé                    Γöérepresentation of the object.           Γöé
  15065. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15066. ΓöéSubclass            ΓöéA class that inherits the same          Γöé
  15067. Γöé                    Γöécharacteristics and behaviors of its    Γöé
  15068. Γöé                    Γöéparent and has its own characteristics  Γöé
  15069. Γöé                    Γöéand behaviors.                          Γöé
  15070. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15071. ΓöéSystem Object Model ΓöéA mechanism that enables programmers to Γöé
  15072. Γöé(SOM)               Γöéuse object-oriented programming         Γöé
  15073. Γöé                    Γöétechniques in a language-independent    Γöé
  15074. Γöé                    Γöémanner.                                 Γöé
  15075. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15076. ΓöéTemplate            ΓöéThe primary user mechanism for creating Γöé
  15077. Γöé                    Γöénew instances of a Workplace object.    Γöé
  15078. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15079. ΓöéView                ΓöéA way of looking at an object's         Γöé
  15080. Γöé                    Γöéinformation.                            Γöé
  15081. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15082. ΓöéWorkplace Shell     ΓöéThe OS/2 2.0 object-oriented, graphical Γöé
  15083. Γöé                    Γöéuser interface.                         Γöé
  15084. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15085.