What APIs are new to OS/2 2.1?

By Marc van Woerkom

=SECTION ONE: Documented New Features=

Source: OS/2 2.1 CP Programming Reference
New CP APIs: APIRET DosProtectClose(HFILE hFile, FHLOCK fhFileHandleLockID)
 * DosProtectClose - Close a Handle to a File, Pipe, or Device
 * DosProtectClose closes a handle to a file, pipe, or device.

APIRET DosProtectEnumAttribute(ULONG ulRefType, PVOID pvFile,                               ULONG ulEntry, PVOID pvBuf,                                ULONG cbBuf, PULONG pulCount,                                ULONG ulInfoLevel,                                FHLOCK fhFileHandleLockID)
 * DosProtectEnumAttribute - Identify Names and Lengths of Extended Attributes
 * DosProtectEnumAttribute identifies names and lengths of extended attributes for a specific file or subdirectory.

APIRET DosProtectOpen(PSZ pszFileName, PHFILE phf, PULONG Action,                      ULONG cbFile, ULONG ulAttribute,                       ULONG fsOpenFlags, ULONG fsOpenMode,                       PEAOP2 peaop2, PFHLOCK pfhFileHandleLockID)
 * DosProtectOpen - Open a File and Return a Protected File Handle
 * DosProtectOpen opens a new file, an existing file, or a replacement for an existing file and returns a protected file handle. An open file can have extended attributes.

APIRET DosProtectQueryFHState(HFILE FileHandle,                              PULONG FileHandleState,                               FHLOCK fhFileHandleLockID)
 * DosProtectQueryFHState - Query File Handle State
 * DosProtectQueryFHState queries the state of the specified protected file handle.

APIRET DosProtectQueryFileInfo(HFILE hf, ULONG ulInfoLevel,                               PVOID pInfo, ULONG cbInfoBuf,                                FHLOCK fhFileHandleLockID)
 * DosProtectQueryFileInfo - Query File Information
 * DosProtectQueryFileInfo gets file information.

APIRET DosProtectRead(HFILE hFile, PVOID pBuffer, ULONG cbRead,                      PULONG pcbActual, FHLOCK fhFileHandleLockID)
 * DosProtectRead - Read from a File, Pipe, or Device to a Buffer
 * DosProtectRead reads the specified number of bytes from a file, pipe, or device to a buffer location.

APIRET DosProtectSetFHState(HFILE FileHandle, ULONG FileHandleState,                            FHLOCK fhFileHandleLockID)
 * DosProtectSetFHState - Set the State of a Specified Protected File Handle
 * DosProtectFHState sets the state of the specified protected file handle.

APIRET DosProtectSetFileInfo(HFILE hf, ULONG ulInfoLevel,                             PVOID pInfoBuf, ULONG cbInfoBuf,                              FHLOCK fhFileHandleLockID)
 * DosProtectSetFileInfo - Set File Information
 * DosProtectSetFileInfo sets file information.

APIRET DosProtectSetFileLocks(HFILE hFile, PFILELOCK pflUnLock,                              PFILELOCK pflLock, ULONG timeout,                               ULONG flags, FHLOCK fhFileHandleLockID)
 * DosProtectSetFileLocks - Lock and Unlock a Range of an Open File
 * DosProtectSetFileLocks locks and unlocks a range of an open file.

APIRET DosProtectSetFilePtr(HFILE FileHandle, LONG Distance,                            ULONG MoveType, PULONG NewPointer,                             FHLOCK fhFileHandleLockID)
 * DosProtectSetFilePtr - Move the Read/Write Pointer
 * DosProtectSetFilePtr moves the read or write pointer according to the type of move specified.

APIRET DosProtectSetFileSize(HFILE hFile, ULONG cbFile,                             FHLOCK fhFileHandleLockID)
 * DosProtectSetFileSize - Change the Size of a File
 * DosProtectSetFileSize changes the size of a file.

APIRET DosProtectWrite(HFILE hFile, PVOID pBuffer, ULONG cbWrite,                       PULONG pcbActual, FHLOCK fhFileHandleLockID)
 * DosProtectWrite -- Write to a File from a Buffer
 * DosProtectWrite writes a specified number of bytes from a buffer to the specified file.

Source: OS/2 2.1 PM Programming Reference Vol. I
(no 2.1 specific information found)

Source: OS/2 2.1 PM Programming Reference Vol. II
New PM APIs: BOOL WinCheckInput(HAB hab)
 * WinCheckInput - Check Input Event Sources
 * This function is used in conjunction with the MsgInputHook hook to input simulated events into the Presentation Manager input processing system.

BOOL WinLockPointerUpdate(HWND hwndDesktop, HPOINTER hptrNew,                          ULONG ulTimeInterval)
 * WinLockPointerUpdate - Change the Mouse Pointer into a Symbol
 * This function causes the mouse pointer to change into the symbol described by hptrNew for the period of time indicated by ulTimeInterval.

BOOL WinLockupSystem(HAB hab)
 * WinLockupSystem - Lock Up System
 * This function locks up the system.

BOOL WinQuerySysPointerData(HWND hwndDesktop, ULONG iptr,                            PICONINFO pIconInfo)
 * WinQuerySysPointerData - Return Icon Data for Specified System Pointer
 * This function returns the icon data for the specified system pointer for application use.

BOOL WinSetPointerOwner(HPOINTER hptr, PID pid, BOOL fDestroy)
 * WinSetPointerOwner - Set Pointer Owner
 * This function allows an application to declare that a pointer it created can now be used by ANY process in the system (not just the process that created the pointer).

BOOL WinSetSysPointerData(HWND hwndDesktop, ULONG iptr,                          PICONINFO pIconInfo) This function sets the given system pointer to the new icon specified by the ICONINFO structure. BOOL WinUnlockSystem(HAB hab, PSZ pszPassword)
 * WinSetSysPointerData - Set System Pointer to New Icon
 * WinUnlockSystem - Unlock System
 * This function causes an application program to attempt to unlock the system.

New WPS classes/methods: WPDataFile.wpQueryAssociatedProgram .wpSetAssociatedFileIcon

WPDisk.wpEjectDisk .wpLockDrive .wpQueryDriveLockStatus

WPObject.wpQueryDefStatusView .wpSetDefStatusView

WPPower.wpAddPowerPage .wpAddPowerViewPager .wpChangePowerState .wpQueryAutoRefresh .wpQueryPowerConfirmation .wpQueryPowerManagement .wpQueryRefreshRate .wpSetAutoRefresh .wpSetPowerConfirmation .wpSetPowerManagement .wpSetRefreshRate

Source: OS/2 2.1 PM Programming Reference Vol. III
New system hooks: BOOL FlushBufHook(HAB hab)
 * FlushBufHook -- Flush Buffer
 * This hook allows applications to save data before the system reboots.

VOID LockupHook(HAB hab, HWND hwndLockupFrame)
 * LockupHook -- Lockup Hook
 * This hook is called when the system locks itself up.

BOOL MsgInputHook(HAB hab, PQMSG pQmsg, BOOL fSkip, PBOOL pfNoRecord)
 * MsgInputHook -- Message Input Hook
 * This hook allows applications to inject one or more events into the system input queue without having to use a journal hook, nor write to the PM input queue directly.

New PM messages: WM_MOUSEMAP -- Remap a mouse message in the PM input queue

New Data Types:
 * MT:A menu template
 * WPPower*:pointer to an instance of WPPower

Source: OS/2 2.1 Toolkit - Getting Started
New Physical Device Driver IOCtls: Category 8, Function 40H -- Unlock, Lock, and Eject Media Category 8, Function 5DH -- Diskette Control Category 8, Function 66H -- Query Lock Status Category 12, Function 40H -- Send Power Event Category 12, Function 41H -- Set Power Event Resource Category 12, Function 60H -- Query Power Status Category 12, Function 61H -- Query Power Event Category 12, Function 62H -- Query Power Info Category 08H, Function 63H -- Get Device Parameters
 * Lockable Drive IOCtls
 * Power Management IOCtls
 * CD-ROM IOCtls

Category 80H, Function 40H -- Reset Drive Category 80H, Function 44H -- Eject Disk Category 80H, Function 46H -- Lock/Unlock Door Category 80H, Function 50H -- Seek Category 80H, Function 60H -- Device Status Category 80H, Function 61H -- Identify CD-ROM Driver Category 80H, Function 63H -- Return Sector Size Category 80H, Function 70H -- Location of Drive Head Category 80H, Function 72H -- Read Long Category 80H, Function 78H -- Return Volume Size Category 80H, Function 79H -- Get UPC

Category 81H, Function 40H -- Audio Channel Control Category 81H, Function 50H -- Play Audio Category 81H, Function 51H -- Stop Audio Category 81H, Function 52H -- Resume Audio Category 81H, Function 60H -- Return Audio-Channel Information Category 81H, Function 61H -- Return Audio-Disk Information Category 81H, Function 62H -- Return Audio-Track Information Category 81H, Function 63H -- Return Audio-Subchannel Q Information Category 81H, Function 65H -- Return Audio-Status Information Category 82H, Function 60H -- Return Drive-Letter Information