Solved

LOGON32_LOGON_NEW_CREDENTIALS - Undeclared Identifier Error

Posted on 2008-06-16
4
1,073 Views
Last Modified: 2012-05-05
Using VS 6.0, LOGON32_LOGON_NEW_CREDENTIALS won't compile correctly. Anyone have any suggestions? This is a win32 windows service.

Code Snippet::

LogonUser(userName.c_str(),domain.c_str(),password.c_str(), LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, &userToken_);

Need a quick turn around on this if someone can figure out why this won't compile....
0
Comment
Question by:rronec1
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Hm, in your other Q, you mentioned you're using VC6 - you will need a new Platform SDK if you are using the files that shipped with VC6, since this constant was introduced years after VC6 was published. Get that update at http://support.microsoft.com/default.aspx?pr=psdk ("Platform SDK")
0
 

Author Comment

by:rronec1
Comment Utility
I just updated the new platform SDK. I updated the tool-options -directories to update the include, lib and bin but the compiler still gives me the following:

error C2065: 'LOGON32_LOGON_NEW_CREDENTIALS' : undeclared identifier

Not sure if there is a specific dir in the new SDK install to point to.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
That's very strange. Here, the SDK shipping with VC++ (aka VS2005) has
//

// Logon Support APIs

//
 

#define LOGON32_LOGON_INTERACTIVE       2

#define LOGON32_LOGON_NETWORK           3

#define LOGON32_LOGON_BATCH             4

#define LOGON32_LOGON_SERVICE           5

#define LOGON32_LOGON_UNLOCK            7

#if(_WIN32_WINNT >= 0x0500)

#define LOGON32_LOGON_NETWORK_CLEARTEXT 8

#define LOGON32_LOGON_NEW_CREDENTIALS   9

#endif // (_WIN32_WINNT >= 0x0500)
 

#define LOGON32_PROVIDER_DEFAULT    0

#define LOGON32_PROVIDER_WINNT35    1

#if(_WIN32_WINNT >= 0x0400)

#define LOGON32_PROVIDER_WINNT40    2

#endif /* _WIN32_WINNT >= 0x0400 */

#if(_WIN32_WINNT >= 0x0500)

#define LOGON32_PROVIDER_WINNT50    3

#endif // (_WIN32_WINNT >= 0x0500)

Open in new window

0
 

Author Comment

by:rronec1
Comment Utility
I went ahead and defined it in the stdafx.h and it worked.

#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0500 // Required for LOGON32_LOGON_NEW_CREDENTIALS and LOGON32_PROVIDER_WINNT50 - W2k and above
#define LOGON32_LOGON_NEW_CREDENTIALS   9


Thanks for your assistance with this. You are very helpful and patience.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

763 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

10 Experts available now in Live!

Get 1:1 Help Now