Solved

Msgina ?

Posted on 1998-12-01
4
286 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

707 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

13 Experts available now in Live!

Get 1:1 Help Now