DosVerifyPidTid: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:DosVerifyPidTid to DosVerifyPidTid |
mNo edit summary |
||
| Line 1: | Line 1: | ||
DosVerifyPidTid validates a PID/TID pair. If the thread and process exist, then a zero return code is set; otherwise the return code indicates whether the thread or the process is invalid. | DosVerifyPidTid validates a PID/TID pair. If the thread and process exist, then a zero return code is set; otherwise the return code indicates whether the thread or the process is invalid. | ||
| Line 5: | Line 4: | ||
<PRE> | <PRE> | ||
#define INCL_DOSMISC | #define INCL_DOSMISC | ||
#include | #include <os2.h> | ||
APIRET APIENTRY DosVerifyPidTid (PID pid, TID tid) | |||
</PRE> | </PRE> | ||
==Parameters== | ==Parameters== | ||
; pid (PID) input | ;pid (PID) input | ||
;tid (TID) input | |||
; tid (TID) input | |||
==Return Code== | ==Return Code== | ||
ulrc (APIRET) returns | ulrc (APIRET) returns | ||
DosVerifyPidTid returns one of the following values | DosVerifyPidTid returns one of the following values | ||
* 0 NO_ERROR | * 0 NO_ERROR | ||
* 303 ERROR_INVALID_PROCID | * 303 ERROR_INVALID_PROCID | ||
* 309 ERROR_INVALID_THREADID | * 309 ERROR_INVALID_THREADID | ||
==Example Code== | ==Example Code== | ||
| Line 58: | Line 51: | ||
} | } | ||
</PRE> | </PRE> | ||
==Related Functions== | ==Related Functions== | ||
* [[ | *[[DosCreateThread]] | ||
* [[ | *[[DosExecPgm]] | ||
[[Category: | [[Category:Dos]] | ||
Revision as of 05:41, 9 January 2017
DosVerifyPidTid validates a PID/TID pair. If the thread and process exist, then a zero return code is set; otherwise the return code indicates whether the thread or the process is invalid.
Syntax
#define INCL_DOSMISC #include <os2.h> APIRET APIENTRY DosVerifyPidTid (PID pid, TID tid)
Parameters
- pid (PID) input
- tid (TID) input
Return Code
ulrc (APIRET) returns
DosVerifyPidTid returns one of the following values
- 0 NO_ERROR
- 303 ERROR_INVALID_PROCID
- 309 ERROR_INVALID_THREADID
Example Code
int main(int argc, char *argv[], char *envp[]){
PID pid=0;
TID tid=1;
int i;
APIRET rc;
if (argc 2) {
printf("VPIDTID /P=pid [/T=tid]\n");
return;
} /* endif */
for (i=1; i(argc ;++i ) {
if (strnicmp (argv[i],"/P=",3)==0) pid=strtoul (argv[i]+3, NULL,16);
else if (strnicmp (argv[i],"/T=",3)==0)
tid=strtoul (argv[i]+3, NULL,16);
} /* endfor */
if (pid == 0) {
printf("VPIDTID /P=pid [/T=tid\n");
return;
} /* endif */
rc=DosVerifyPidTid (pid,tid);
printf("Verify pid=0x%04x tid=0x%04x rc=%u\n", pid,tid,rc);
return 0;
}