Jump to content

ProgramListEntryHook: Difference between revisions

From EDM2
Created page with "This hook chain is called every time a program-list call or initialization file call is invoked by an application. It is called before the call is run. ==Syntax== rc = ProgramListEntryHook(hab, pProfileHookParams, fNoExecute); ==Parameters== ;''hab'' (HAB) - input: Anchor-block handle. ;''pProfileHookParams'' (PRFHOOKPARMS) - input: Profile hook parameters. These identify the call and give its parameters and return code. See PRFHOOKPARMS for more information. ;''fN..."
 
No edit summary
 
Line 2: Line 2:


==Syntax==
==Syntax==
rc = ProgramListEntryHook(hab, pProfileHookParams, fNoExecute);
ProgramListEntryHook(hab, pProfileHookParams, fNoExecute);


==Parameters==
==Parameters==

Latest revision as of 19:39, 13 April 2025

This hook chain is called every time a program-list call or initialization file call is invoked by an application. It is called before the call is run.

Syntax

ProgramListEntryHook(hab, pProfileHookParams, fNoExecute);

Parameters

hab (HAB) - input
Anchor-block handle.
pProfileHookParams (PRFHOOKPARMS) - input
Profile hook parameters. These identify the call and give its parameters and return code. See PRFHOOKPARMS for more information.
fNoExecute (BOOL) - output
Suppress indicator.
TRUE: If this is set by any hook procedure, no further processing of the call is done.
FALSE: If all hook procedures set fNoExecute to FALSE, the call is processed normally.
rc (BOOL) - returns
Processed indicator.
TRUE: The next hook in the chain is not called.
FALSE: The next hook in the chain is called.

Returns

rc (BOOL) - returns
Processed indicator.
TRUE: The next hook in the chain is not called.
FALSE: The next hook in the chain is called.

Remarks

This hook, together with ProgramListExitHook lets applications or system components to do the following:

  1. Implement the initialization file and program list partially, while retaining the existing implementation. For example, read-only requests could be satisfied from memory, rather than from disk.
  2. Redirect initialization-file operations on a particular group to an alternative (opened) profile. For example, in a multiple-user environment, a LAN program might choose to redirect profile groups that are hardware-dependent, rather than user-dependent, to the system-initialization file.

Example Code

#define INCL_FnDrEnPt
#include <os2.h>

HAB            hab;                /* Anchor-block handle. */
PRFHOOKPARMS   pProfileHookParams; /* Profile hook parameters. */
BOOL           fNoExecute;         /* Suppress indicator. */
BOOL           rc;                 /* Processed indicator. */

rc = ProgramListEntryHook(hab, pProfileHookParams,
       fNoExecute);