Solved

WNetAddConnection2 - "The network path was not found"

Posted on 2001-08-23
12
3,164 Views
Last Modified: 2007-11-27
I'm trying to use a modem to RAS into a server and map a drive. The RasDial() connects and authenticates fine, but when I actually try to map a drive, it fails.

Here's what I'm doing once I connect:

   nrServer.dwType = RESOURCETYPE_ANY;
   nrServer.lpLocalName = L"Z:";
   nrServer.lpRemoteName = L"\\MyServer\MyPath";
   nrServer.lpProvider = L"";

   dwError = WNetAddConnection2(&nrServer,
                                L"MyPassword",
                                L"MyUserName", 0);

This fails with dwError = 0x35 - 'The network path was not found.'

It is on our corporate network and if I call WNetAddConnection2() from a machine with an ethernet connection, it maps fine...

I've heard that there may be a configuration on some networks where the password and user name need to be reversed in WNetAddConnection2() but when I try that & get an error about an incorrect password (duh...). If I leave the password and user out, I get the same 0x35 error.

Any advice?
0
Comment
Question by:Grailman
12 Comments
 
LVL 1

Author Comment

by:Grailman
Comment Utility
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
I'm not where I can test this, but does it make any difference if you use RESOURCETYPE_DISK ?

I read that error 53 (0x35) is often used as a grab bag since in NT 3x, it would force an immediate halt to some time-consuming network operations.  If that's what's happening, there might be a security issue involved.  If the server thinks that you have no right poking your nose around, it might be using this error to preempt you out of the system.

Do you have any trouble if you use Dialup Networking to logon to that server manually?  If you have not tried it, do so -- the popup error messages could be enlightening.  During the login, you may need to specify a Domain name and/or a valid username/password (recognized by the server)  

And to connect to a drive share, that user name might need to have specific privileges on the specified sharename.

See what happens with the above suggestions.  If you're still having problems, I have some ways to test this out tomorrow.

BTW -- what OS is the host and what OS is the client?

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
Actually the remote name was \\\\MyServer\\MyPath

MyBad ;-o
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
I think that narrows it down to a security issue.  In the Dialup networking, what protocols are in effect?  You could try eliminating all except for NetBeui to try to force a fallback the good old days of Workgroup style security.

Also, the login username and password (and Domain) from the username password prompt must match what is expected by the host.  For testing, add this user to the host and give him administrator priveledges.  Also verify that the shared directory on the host provides full access to everybody on earth.

Check your RAS settings as to what permisssions the dialup connections will receive.

-- Dan
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
I can connect w/ Dial-up Networking and I get a message that:

"You have successfully connected to the remote server. You may now use the usual Windows NT programs and utilities as if you were directly connected to the network"

When I go to Windows Explorer I see a couple (out of say 2 dozen) of machines on the network but when I click them, I get an error "The network path was not found"

The host is either NT4 or W2K and the client is NT4 with SP5.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
do i hear an echo?

-- Dan
0
 
LVL 9

Expert Comment

by:BeyondWu
Comment Utility
Listening...
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 0 total points
Comment Utility
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
Found it!

It turned out that the NIC I had in my machine was bound to the same network as the machine I wanted to map to. Remember I said I could map using the NIC? Well when I unplugged the cable and tried to map after I had made a modem connection, my machine still tried to use the NIC since the networks were the same. Once I released the NIC adapter I was able to map just fine using the modem connection.

Note: I would not have seen this situation if I had tried it on one of our machines in the field since their NIC adapters are bound to another network... DOOH!
0
 
LVL 3

Expert Comment

by:modder
Comment Utility
Grailman, as requested I have refunded your points. I've accepted AlexVirochovsky's comment to make it a PAQ. Sorry, Alex, no points, but at least a nice "A" to show in your profile ;-)

modder
Community Support
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now