3.1.4.29 NetprPathType (Opnum 30)
The NetprPathType method checks a path name to determine its type.
-
NET_API_STATUS NetprPathType( [in, string, unique] SRVSVC_HANDLE ServerName, [in, string] WCHAR* PathName, [out] DWORD* PathType, [in] DWORD Flags );
ServerName: An SRVSVC_HANDLE (section 2.2.1.1) pointer that identifies the server. The client MUST map this structure to an RPC binding handle (see [C706] sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.
PathName: A pointer to a null-terminated UTF-16 string that specifies the path name to check.
PathType: A path type is returned. It MUST be one of the values that are defined in section 2.2.2.9.
Flags: A bitmask that MUST contain the bitwise OR of zero or more of the following values specifying controlling flags.
-
Value
Meaning
0x00000001
If set, the method uses old-style path rules (128-byte paths, 8.3 components) when validating the path. This flag is set on MS-DOS and OS/2 1.1 systems.
Return Values: The method returns 0x00000000 (NERR_Success) to indicate success; otherwise, it returns a nonzero error code. The method can take any specific error code value, as specified in [MS-ERREF] section 2.2.
In response to a NetprPathType message, the server MUST parse the specified path, determining if it is a valid path and determining its path type, or return an error code. Path type values are defined in section 2.2.2.9.
The PathName parameter specifies the path name whose type needs to be determined.
If the PathName parameter is an empty string or has a length greater than 260, the server MUST fail the call with ERROR_INVALID_NAME. If the Flag parameter has a value other than 0 or 1, the server MUST fail the call with ERROR_INVALID_PARAMETER.
If the Flag parameter is 0x1, the server MUST use old (MS-DOS) style path name rules that state that a path name can be 128 bytes long and that the file portion of the path has an 8-bit name and a 3-bit extension. If the value of the Flag parameter is 0x0, the server MUST use the long path name rules as specified in [MS-CIFS] section 2.2.1.1.1.
The server MUST obtain the path type value for the PathName by using the algorithm as specified in section 3.1.1.9. If the algorithm yields ERROR_INVALID_NAME, the server MUST fail the call with the same error code. Otherwise, the server MUST copy the path type value resulting from the algorithm into PathType and return NERR_Success.
The server MAY<109> enforce security measures to verify that the caller has the required permissions to execute this call. If the server enforces these security measures and the caller does not have the required credentials, the server SHOULD<110> fail the call.