* fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
(thread_netdrive): Drop GET_RESOURCE_INFO case. (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class to check for existance.
This commit is contained in:
parent
8b800efea5
commit
5e5a843711
|
@ -1,3 +1,10 @@
|
||||||
|
2009-07-15 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove.
|
||||||
|
(thread_netdrive): Drop GET_RESOURCE_INFO case.
|
||||||
|
(fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class
|
||||||
|
to check for existance.
|
||||||
|
|
||||||
2009-07-15 Corinna Vinschen <corinna@vinschen.de>
|
2009-07-15 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
|
* fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless
|
||||||
|
|
|
@ -23,7 +23,6 @@ details. */
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
GET_RESOURCE_INFO = 0,
|
|
||||||
GET_RESOURCE_OPENENUM = 1,
|
GET_RESOURCE_OPENENUM = 1,
|
||||||
GET_RESOURCE_OPENENUMTOP = 2,
|
GET_RESOURCE_OPENENUMTOP = 2,
|
||||||
GET_RESOURCE_ENUM = 3
|
GET_RESOURCE_ENUM = 3
|
||||||
|
@ -57,11 +56,6 @@ thread_netdrive (void *arg)
|
||||||
ReleaseSemaphore (ndi->sem, 1, NULL);
|
ReleaseSemaphore (ndi->sem, 1, NULL);
|
||||||
switch (ndi->what)
|
switch (ndi->what)
|
||||||
{
|
{
|
||||||
case GET_RESOURCE_INFO:
|
|
||||||
nro = (LPNETRESOURCE) alloca (size = 4096);
|
|
||||||
ndi->ret = WNetGetResourceInformation ((LPNETRESOURCE) ndi->in,
|
|
||||||
nro, &size, &dummy);
|
|
||||||
break;
|
|
||||||
case GET_RESOURCE_OPENENUMTOP:
|
case GET_RESOURCE_OPENENUMTOP:
|
||||||
nro = (LPNETRESOURCE) alloca (size = 4096);
|
nro = (LPNETRESOURCE) alloca (size = 4096);
|
||||||
nh = (struct net_hdls *) ndi->out;
|
nh = (struct net_hdls *) ndi->out;
|
||||||
|
@ -164,15 +158,20 @@ fhandler_netdrive::exists ()
|
||||||
*to = (*from == '/') ? '\\' : *from;
|
*to = (*from == '/') ? '\\' : *from;
|
||||||
*to = '\0';
|
*to = '\0';
|
||||||
|
|
||||||
|
struct net_hdls nh = { NULL, NULL };
|
||||||
NETRESOURCE nr = {0};
|
NETRESOURCE nr = {0};
|
||||||
nr.dwScope = RESOURCE_GLOBALNET;
|
|
||||||
nr.dwType = RESOURCETYPE_DISK;
|
nr.dwType = RESOURCETYPE_DISK;
|
||||||
nr.lpLocalName = NULL;
|
|
||||||
nr.lpRemoteName = namebuf;
|
nr.lpRemoteName = namebuf;
|
||||||
DWORD ret = create_thread_and_wait (GET_RESOURCE_INFO, &nr, NULL, 0,
|
DWORD ret = create_thread_and_wait (GET_RESOURCE_OPENENUM,
|
||||||
"WNetGetResourceInformation");
|
&nr, &nh, 0, "WNetOpenEnum");
|
||||||
if (ret != ERROR_MORE_DATA && ret != NO_ERROR)
|
if (ret != NO_ERROR)
|
||||||
|
{
|
||||||
|
if (nh.dom)
|
||||||
|
WNetCloseEnum (nh.dom);
|
||||||
|
if (nh.net)
|
||||||
|
WNetCloseEnum (nh.net);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue