Solved

Msgina ?

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

691 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