Solved

Msgina ?

Posted on 1998-12-01
4
292 Views
Last Modified: 2008-03-03
I've written a new MSGINA.DLL and one thing is not working correctly. The drive that is specified in the home directory of the user is mounted but I've an error from Winlogon after the connection. I use the WNetAddConnection function. Is it good ? Is there another solution to mount drives ? etc...
0
Comment
Question by:euritis
4 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1178956
Don't you think this question will get better responses if posted in the "Windows" programming area?  After all, there is absolutely no C++ involved...
0
 
LVL 86

Expert Comment

by:jkr
ID: 1178957
I'd suggest using 'WNetAddConnection2()' instead, as it offers more fexibility...
0
 
LVL 6

Accepted Solution

by:
stsanz earned 100 total points
ID: 1178958
Do you impersonate your process before mounting the drive ?
Here is some code I use in my GINA :

// Impersonation
bRes = ImpersonateLoggedOnUser(hUserToken) ;

nr.dwType = RESOURCETYPE_DISK ;
nr.lpLocalName = szHomeDirDrive ;
nr.lpRemoteName = szHomeDir ;
nr.lpProvider = NULL ;
dwRes = WNetAddConnection2(&nr,lpszPassword,lpszUserName,0) ;

// Cancel Impersonation
RevertToSelf() ;

0
 

Author Comment

by:euritis
ID: 1178959
Thanks a lot
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

733 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