Hi Rich!
Ahh...Da Man himself (Rich is the author of oo, as well as the client/server portions that are utilized by oo)...alright sir.
DEBUG ParseArgs => processing argument:0
DEBUG ParseObject => pArg:v:\photo
DEBUG ParseObject => pPath:
DEBUG ParseObject => DosQueryPathInfo API RC:15
invalid or malformed path
I wouldn't claim to really understand what the above is saying, but shouldn't 'pPath:' be displaying "v:\photo"? If the path is null, rc=15 (ERROR_INVALID_DRIVE) would not be inappropriate.
You would be correct about that last statement, which is how I initially understood the code to work as well. However, upon further review I realized that this initial call to DosQueryPathInfo actually only checks that the path is a valid location. If so, there is a 2nd call to this API which then actually does the grunt work.
Specifically, here is the section of the code we are talking about:
...
// expand partially-qualified names
rc = DosQueryPathInfo(pArg, FIL_QUERYFULLNAME, pPath, CCHMAXPATH);
printf("\nDEBUG ParseObject => DosQueryPathInfo API RC:%ld\n", rc);
if (rc != 0)
ERRBRK( "invalid or malformed path")
// if we actually find something, then this is a file or directory;
// otherwise, assume this is an abstract object's title
if (DosQueryPathInfo( pPath, FIL_STANDARD, &fs3, sizeof(fs3)))
*pType = typeTitle;
else
*pType = RWSI_OPATH;
fRtn = TRUE;
...
Since the 1st DosQueryPathInfo uses FIL_QUERYFULLNAME, that is a LEVEL_5 information block request, and per the CP book that "Level 5 returns the fully qualified ASCIIZ name of PathName in PathInfoBuf. PathName may contain global file-name characters". It is only at that point in time that pPath actually gets a value assigned to it, that being the fully qualified ASCIIZ path name.
Afterwards the 2nd DosQueryPathInfo call captures the LEVEL_3 info block into the 'fs3' variable.
So for some reason that 1st call fails here, but it only fails when executed from within my REXX script. If oo.exe is ran directly from CLI that works fine.
Here is a quick output of cflow showing where the oo.exe code halts:
1 { 0} +-main: int (int argc, char *argv[]), <oo.c 194>
2 { 1} +-RwsQueryVersion: <>
3 { 1} +-ErrMsg: void (char *msg, ULONG rc), <oo.c 1297>
4 { 2} | +-RwsGetRcString: <>
5 { 2} | +-sprintf: <>
6 { 2} | +-DosWrite: <>
7 { 2} | \-strlen: <>
8 { 1} +-printf: <>
9 { 1} +-ParseArgs: BOOL (int argc, char *argv[]), <oo.c 287>
10 { 2} | +-ParseExe: int (char *pArg), <oo.c 544>
11 { 3} | | +-strrchr: <>
12 { 3} | | +-strspn: <>
13 { 3} | | +-strchr: <>
14 { 3} | | \-UppercaseArg: BOOL (char *pArg), <oo.c 839>
15 { 4} | | +-DosMapCase: <>
16 { 4} | | \-strlen: <>
17 { 2} | +-printf: <>
18 { 2} | +-strspn: <>
19 { 2} | +-strchr: <>
20 { 2} | +-ERRBRK: <>
21 { 2} | +-ParseOption: int (char *pArg), <oo.c 591>
22 { 3} | | +-UppercaseArg: 14
23 { 3} | | +-strchr: <>
24 { 3} | | \-ErrMsg: 3
25 { 2} | +-ParseObject: BOOL (char *pArg, char *pPath, PULONG pType), <oo.c 640>
26 { 3} | | +-printf: <>
27 { 3} | | +-strchr: <>
DEBUG => This next statement is what catches the DosQueryPathInfo API call's RC=15
28 { 3} | | +-ERRBRK: <>
29 { 3} | | +-strcpy: <>
30 { 3} | | +-ParseHandle: BOOL (char *pArg, char *pPath, PULONG pType), <oo.c 736>
31 { 4} | | | +-strlen: <>
...