mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 08:17:09 +08:00
[SHLWAPI] PathIsDirectory: Support UNC Server Share (#8907)
Implementing missing features... We lack network support. JIRA issue: CORE-19278, CORE-17923 Implement network support on PathIsDirectoryA/W functions.
This commit is contained in:
committed by
GitHub
parent
a2c594187e
commit
262842c39b
@@ -35,6 +35,9 @@
|
||||
#include "winternl.h"
|
||||
#define NO_SHLWAPI_STREAM
|
||||
#include "shlwapi.h"
|
||||
#ifdef __REACTOS__
|
||||
#include "winnetwk.h"
|
||||
#endif
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
@@ -1712,8 +1715,27 @@ BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath)
|
||||
|
||||
if (PathIsUNCServerShareA(lpszPath))
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
LPSTR lpSystem = NULL;
|
||||
BYTE buffer[512] = {0};
|
||||
DWORD cbBuffer = sizeof(buffer);
|
||||
LPNETRESOURCEA pNetRes = (LPNETRESOURCEA)buffer;
|
||||
DWORD dwError;
|
||||
|
||||
pNetRes->dwScope = RESOURCE_GLOBALNET;
|
||||
pNetRes->dwType = RESOURCETYPE_ANY;
|
||||
pNetRes->lpRemoteName = (LPSTR)lpszPath;
|
||||
|
||||
dwError = WNetGetResourceInformationA(pNetRes, pNetRes, &cbBuffer, &lpSystem);
|
||||
if (dwError == NO_ERROR && pNetRes->dwDisplayType != RESOURCEDISPLAYTYPE_GENERIC)
|
||||
{
|
||||
return (pNetRes->dwDisplayType == RESOURCEDISPLAYTYPE_SHARE) &&
|
||||
(pNetRes->dwType == RESOURCETYPE_ANY || pNetRes->dwType == RESOURCETYPE_DISK);
|
||||
}
|
||||
#else
|
||||
FIXME("UNC Server Share not yet supported - FAILING\n");
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((dwAttr = GetFileAttributesA(lpszPath)) == INVALID_FILE_ATTRIBUTES)
|
||||
@@ -1737,8 +1759,27 @@ BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
|
||||
|
||||
if (PathIsUNCServerShareW(lpszPath))
|
||||
{
|
||||
#ifdef __REACTOS__
|
||||
LPWSTR lpSystem = NULL;
|
||||
BYTE buffer[1024] = {0};
|
||||
DWORD cbBuffer = sizeof(buffer);
|
||||
LPNETRESOURCEW pNetRes = (LPNETRESOURCEW)buffer;
|
||||
DWORD dwError;
|
||||
|
||||
pNetRes->dwScope = RESOURCE_GLOBALNET;
|
||||
pNetRes->dwType = RESOURCETYPE_ANY;
|
||||
pNetRes->lpRemoteName = (LPWSTR)lpszPath;
|
||||
|
||||
dwError = WNetGetResourceInformationW(pNetRes, pNetRes, &cbBuffer, &lpSystem);
|
||||
if (dwError == NO_ERROR && pNetRes->dwDisplayType != RESOURCEDISPLAYTYPE_GENERIC)
|
||||
{
|
||||
return (pNetRes->dwDisplayType == RESOURCEDISPLAYTYPE_SHARE) &&
|
||||
(pNetRes->dwType == RESOURCETYPE_ANY || pNetRes->dwType == RESOURCETYPE_DISK);
|
||||
}
|
||||
#else
|
||||
FIXME("UNC Server Share not yet supported - FAILING\n");
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((dwAttr = GetFileAttributesW(lpszPath)) == INVALID_FILE_ATTRIBUTES)
|
||||
|
||||
Reference in New Issue
Block a user