mapping network drive

D

dcarney

Hi there,

I am using minlogon, with a custom application as the shell. In my app
code, I use an API call to WNetAddConnection2 to map a network drive.
This works fine under XP, but obviously fails under XPe. The host is
pingable.

In addition to minlogon, I am using the Basic TCP/IP Networking macro.
All my other networking code runs fine.

I know that the WNetAddConnection2 routine is in the mpr.dll, which IS
included in my build.

Does anyone know what I could be missing from my build that would keep
this type of functionality from working correctly?
Thanks ahead of time,
~Dylan
 
K

KM

Dylan,

How about testing the sharing with "net share" command first?

Also, you can add these macro components:
"File Sharing"
"TCP/IP Networking with File Sharing and Client for MS Networks"

and,
"Map Network Drives/Network Places Wizard"
"Primitive:MPRUI"
which you don't necessarily need but they will bring in the necessary dependencies.

Btw, to have some network drives pre-populated you can set up the reg keys under [HKEY_CURRENT_USER\Network] in your build.
 
S

Slobodan Brcin \(eMVP\)

Dylan,

If you want to skip few steps you can use API function "NetUseAdd"
WNetAddConnection2 is much higher in food chain and at the end it uses NetUseAdd for actual access to redirector driver.

Regards,
Slobodan

KM said:
Dylan,

How about testing the sharing with "net share" command first?

Also, you can add these macro components:
"File Sharing"
"TCP/IP Networking with File Sharing and Client for MS Networks"

and,
"Map Network Drives/Network Places Wizard"
"Primitive:MPRUI"
which you don't necessarily need but they will bring in the necessary dependencies.

Btw, to have some network drives pre-populated you can set up the reg keys under [HKEY_CURRENT_USER\Network] in your build.

--
Regards,
KM, BSquare Corp.

Hi there,

I am using minlogon, with a custom application as the shell. In my app
code, I use an API call to WNetAddConnection2 to map a network drive.
This works fine under XP, but obviously fails under XPe. The host is
pingable.

In addition to minlogon, I am using the Basic TCP/IP Networking macro.
All my other networking code runs fine.

I know that the WNetAddConnection2 routine is in the mpr.dll, which IS
included in my build.

Does anyone know what I could be missing from my build that would keep
this type of functionality from working correctly?
Thanks ahead of time,
~Dylan
 
K

KM

Oh, you are right. NetAPI is the way to go rather than redirecting a local drive to a network resource :)

--
Regards,
KM, BSquare Corp.

Dylan,

If you want to skip few steps you can use API function "NetUseAdd"
WNetAddConnection2 is much higher in food chain and at the end it uses NetUseAdd for actual access to redirector driver.

Regards,
Slobodan

KM said:
Dylan,

How about testing the sharing with "net share" command first?

Also, you can add these macro components:
"File Sharing"
"TCP/IP Networking with File Sharing and Client for MS Networks"

and,
"Map Network Drives/Network Places Wizard"
"Primitive:MPRUI"
which you don't necessarily need but they will bring in the necessary dependencies.

Btw, to have some network drives pre-populated you can set up the reg keys under [HKEY_CURRENT_USER\Network] in your build.

--
Regards,
KM, BSquare Corp.

Hi there,

I am using minlogon, with a custom application as the shell. In my app
code, I use an API call to WNetAddConnection2 to map a network drive.
This works fine under XP, but obviously fails under XPe. The host is
pingable.

In addition to minlogon, I am using the Basic TCP/IP Networking macro.
All my other networking code runs fine.

I know that the WNetAddConnection2 routine is in the mpr.dll, which IS
included in my build.

Does anyone know what I could be missing from my build that would keep
this type of functionality from working correctly?
Thanks ahead of time,
~Dylan
 
D

dcarney

Thanks for your help guys. You've saved me a bunch of time.

It works using the first suggested method, but if I can save a little
overhead and bloat by using the NetUseAdd, I will.
Thanks again,
~Dylan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top