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
Solved

Msgina ?

Posted on 1998-12-01
4
291 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Title # Comments Views Activity
Building cUrl in Windows v7.43.0 4 36
Dialogbox API leak? 18 98
Problem with SqlConnection 4 176
Installshield for Embarcadero EX 10.1 Berlin 4 59
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

792 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