SHValidateUNC function
[SHValidateUNC is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]
Validates a Universal Naming Convention (UNC) path by calling WNetAddConnection3. The function makes it possible for the user to type a remote network access (RNA) UNC application or document name from the Run dialog box on the Start menu.
Syntax
BOOL SHValidateUNC( _In_opt_ HWND hwndOwner, _Inout_ PWSTR pszFile, UINT fConnect );
Parameters
- hwndOwner [in, optional]
-
Type: HWND
Handle of the parent window, used to display UI. If this is not needed, this value can be set to NULL.
- pszFile [in, out]
-
Type: PWSTR
A pointer to a null-terminated Unicode string that specifies the UNC path to validate. Note: This string must not be a constant string.
- fConnect
-
Type: UINT
One or more of the following values.
-
Connect a drive letter. When this flag is set, the value in pszFile is changed to the local drive to which the UNC is mapped on the local machine.
-
On either failure or success, display no UI.
-
Validate as a print share rather than disk share.
-
Windows Vista and later. The connection should be made persistent.
-
Mask value used to verify that the flags passed to SHValidateUNC are valid.
Return value
Type: BOOL
Returns TRUE if the UNC path exists; FALSE if the UNC path does not exist or if some other failure occurred.
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
End of client support |
Windows Vista |
|
End of server support |
Windows Server 2003 |
|
Header |
|
|
Library |
|
|
DLL |
|