Changeset 20


Ignore:
Timestamp:
Oct 7, 2014, 4:25:50 PM (11 years ago)
Author:
Alex Taylor
Message:

Sys2QueryProcess now accepts a PID of 0 for the current process. Version number increased to 0.1.0.

Location:
rxutilex/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • rxutilex/trunk/FUNCTIONS

    r19 r20  
    344344Sys2QueryForegroundProcess
    345345
    346 Queries the PID of the current foreground process.
     346Queries the PID of the current foreground process. (Note that this is not
     347necessarily the same as the process which is calling this function, which
     348could, for example, be running in the background and/or as a child of the
     349foreground process.)
    347350
    348351REXX ARGUMENTS: None
     
    369372
    370373Queries information about the specified process.
     374
     375Specifying a process ID of 0 will return the information for the
     376current process (that is, the process calling this function); note that
     377this requires the second parameter to specify that the identifier is in
     378fact a process ID ('P' or 'H') rather than an executable name.
    371379
    372380REXX ARGUMENTS:
  • rxutilex/trunk/Makefile

    r18 r20  
    1616
    1717$(NAME).dll : $(NAME).obj
    18                 makedesc -D"Extra REXX Utility Functions" -N"Alex Taylor" -V"^#define=SZ_VERSION,rxutilex.c" $(NAME).def
     18                makedesc -D"Extended REXX Utility Functions" -N"Alex Taylor" -V"^#define=SZ_VERSION,rxutilex.c" $(NAME).def
    1919                $(LINK) $(LFLAGS) $(NAME).obj $(NAME).def $(LIBS) /O:$@
    2020#                @dllrname.exe $@ CPPOM30=OS2OM30 /Q /R
  • rxutilex/trunk/rxutilex.c

    r18 r20  
    7373#define SZ_LIBRARY_NAME         "RXUTILEX"  // Name of this library
    7474#define SZ_ERROR_NAME           "SYS2ERR"   // REXX variable used to store error codes
    75 #define SZ_VERSION              "0.0.5"     // Current version of this library
     75#define SZ_VERSION              "0.1.0"     // Current version of this library
    7676
    7777// Maximum string lengths...
     
    19561956    CHAR   szName[ CCHMAXPATH ]  = {0}, // Fully-qualified name of process
    19571957           szNoExt[ CCHMAXPATH ] = {0}; // Program name without extension
     1958    PPIB   ppib;                        // pointer to current process info block
    19581959    PSZ    pszCurrent,                  // Program name of a queried process
    19591960           c;                           // Pointer to substring
     
    19641965    APIRET rc;                          // Return code
    19651966
     1967
     1968    // Use current process when PID is 0 and program name is not specified
     1969    if (( pszProgram == NULL ) && ( *pulPID == 0 )) {
     1970        rc = DosGetInfoBlocks( NULL, &ppib );
     1971        if ( rc != NO_ERROR ) {
     1972            WriteErrorCode( rc, "DosGetInfoBlocks");
     1973            return ( rc );
     1974        }
     1975        *pulPID = ppib->pib_ulpid;
     1976    }
    19661977
    19671978#ifdef USE_DQPS
  • rxutilex/trunk/rxutilex.def

    r18 r20  
    11LIBRARY     RXUTILEX INITINSTANCE TERMINSTANCE
    22DATA        MULTIPLE NONSHARED
    3 DESCRIPTION '@#Alex Taylor:0.0.5#@##1## 21 Sep 2014 16:45:48     REINFORCE::::::@@Extra REXX Utility Functions'
     3DESCRIPTION '@#Alex Taylor:0.1.0#@##1## 7 Oct 2014 22:42:18      REINFORCE::::::@@Extra REXX Utility Functions'
    44
    55EXPORTS     Sys2LoadFuncs
  • rxutilex/trunk/testlib.cmd

    r17 r20  
    1111
    1212say Sys2QueryProcess( 40, 'P')
     13say 'Current process:' Sys2QueryProcess( 0, 'P')
    1314
    1415pc = Sys2QueryProcessList('procs.')
    1516say pc 'processes found.'
     17/*
    1618do i = 1 to procs.0
    1719    say procs.i
    1820end
     21*/
    1922say 'Current foreground process:' Sys2QueryForegroundProcess()
    2023/*
Note: See TracChangeset for help on using the changeset viewer.