Jump to content

FSH CANONICALIZE: Difference between revisions

From EDM2
Created page with "This function converts a path name to a canonical form by processing ' .'s and '..'s, uppercasing, and prepending the current directory to non-absolute paths. ==Syntax== ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function converts a path name to a canonical form by processing ' .'s and '..'s, uppercasing, and prepending the current directory to non-absolute paths.  
This function converts a path name to a canonical form by processing '.'s and '..'s, uppercasing, and prepending the current directory to non-absolute paths.


==Syntax==
==Syntax==
  FSH_CANONICALIZE(pPathName, cbPathBuf, pPathBuf, pFlags)
  FSH_CANONICALIZE(pPathName, cbPathBuf, pPathBuf, pFlags)
==Parameters==
==Parameters==
;pPathName: is a pointer to the ASCIIZ path name to be canonicalized.  
;pPathName: is a pointer to the ASCIIZ path name to be canonicalized.
 
;cbPathBuf: is the length of path name buffer.
;cbPathBuf: is the length of path name buffer.  
;pPathBuf: is the pointer to the buffer into which to copy the canonicalized path.
 
;pFlags: is the pointer to flags returned to the FSD.
;pPathBuf: is the pointer to the buffer into which to copy the canonicalized path.  
:Flags == 0x0040 indicates a non-8.3 filename format. All other values are reserved.


;pFlags: is the pointer to flags returned to the FSD. 
:Flags == 0x0040 indicates a non-8.3 filename format. All other values are reserved.
==Returns==
==Returns==
If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:  
If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:
 
*ERROR_PATH_NOT_FOUND : is an invalid path name-too many '..'s
:*ERROR_PATH_NOT_FOUND  
*ERROR_BUFFER_OVERFLOW : the path name is too long.
::is an invalid path name-too many '..'s  
 
:*ERROR_BUFFER_OVERFLOW  
::the path name is too long.  


==Calling Sequence==
==Calling Sequence==
Line 31: Line 25:
unsigned short far * pFlags;
unsigned short far * pFlags;
</PRE>
</PRE>
==Remarks==
==Remarks==
This routine processes DBCS characters properly.  
This routine processes DBCS characters properly.


The FSD is responsible for verifying the string pointers and checking for segment boundaries.  
The FSD is responsible for verifying the string pointers and checking for segment boundaries.


FSH_CANONICALIZE should be called for names passed into the FSD raw data packets. For example, names passed to FS_FSCTL in the parameter area should be passed to FSH_CANONICALIZE. This routine does not need to be called for explicit names passed to the FSD, that is, the name passed to FS_OPENCREATE.  
FSH_CANONICALIZE should be called for names passed into the FSD raw data packets. For example, names passed to FS_FSCTL in the parameter area should be passed to FSH_CANONICALIZE. This routine does not need to be called for explicit names passed to the FSD, that is, the name passed to FS_OPENCREATE.


If the canonicalized name is being created as a file or directory, the non-8 .3 attribute in the directory entry should be set according to the value returned in pFlags.  
If the canonicalized name is being created as a file or directory, the non-8.3 attribute in the directory entry should be set according to the value returned in pFlags.


;Note: OS/2 does not validate input parameters. Therefore, an FSD should call FSH_PROBEBUF where appropriate.  
;Note: OS/2 does not validate input parameters. Therefore, an FSD should call FSH_PROBEBUF where appropriate.


[[Category:IFS Interfaces]]
[[Category:IFS Interfaces]]
{{DISPLAYTITLE:FSH_CANONICALIZE}}
{{DISPLAYTITLE:FSH_CANONICALIZE}}

Latest revision as of 17:18, 12 February 2020

This function converts a path name to a canonical form by processing '.'s and '..'s, uppercasing, and prepending the current directory to non-absolute paths.

Syntax

FSH_CANONICALIZE(pPathName, cbPathBuf, pPathBuf, pFlags)

Parameters

pPathName
is a pointer to the ASCIIZ path name to be canonicalized.
cbPathBuf
is the length of path name buffer.
pPathBuf
is the pointer to the buffer into which to copy the canonicalized path.
pFlags
is the pointer to flags returned to the FSD.
Flags == 0x0040 indicates a non-8.3 filename format. All other values are reserved.

Returns

If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:

  • ERROR_PATH_NOT_FOUND : is an invalid path name-too many '..'s
  • ERROR_BUFFER_OVERFLOW : the path name is too long.

Calling Sequence

int far pascal FSH_CANONICALIZE(pPathName, cbPathBuf, pPathBuf, pFlags)

char far * pPathName;
unsigned short cbPathBuf;
char far * pPathBuf;
unsigned short far * pFlags;

Remarks

This routine processes DBCS characters properly.

The FSD is responsible for verifying the string pointers and checking for segment boundaries.

FSH_CANONICALIZE should be called for names passed into the FSD raw data packets. For example, names passed to FS_FSCTL in the parameter area should be passed to FSH_CANONICALIZE. This routine does not need to be called for explicit names passed to the FSD, that is, the name passed to FS_OPENCREATE.

If the canonicalized name is being created as a file or directory, the non-8.3 attribute in the directory entry should be set according to the value returned in pFlags.

Note
OS/2 does not validate input parameters. Therefore, an FSD should call FSH_PROBEBUF where appropriate.