?
Solved

Msgina ?

Posted on 1998-12-01
4
Medium Priority
?
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

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