C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 12-19-2004, 02:24 PM   #1
Registered User
 
Join Date: Dec 2001
Posts: 479
Question..

hi,
i'm having a problem with a structure i found at MSDN.
the problem is that the complielr doesnt seem recognize this structure.
im using devc++ right now, and i have the platform sdk installed.
and i have included the header too!


here it is

what could be the problem?
pode is offline   Reply With Quote
Old 12-19-2004, 04:13 PM   #2
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
The problem is that it's not typedef'd in ntsecpkg.h.

Generally, if you come across such issues with dev-cpp, check out msdn to identify the header it's in and search for the missing define/typedef in that header. If it's present in the header file then it's probably enclosed within an #ifdef SOME_CONSTANT....#endif preprocessor conditional block so you'll probably get away with just #defining SOME_CONSTANT prior to #including that particular header. If it's absent, as this struct is, and you are confident that your mingw win32api is at least current, then check out winsup cvs to see if there's an up-to-the-minute version of that particular header.

Unfortunately, it seems that ntsecpkg.h was last updated a couple of years ago.

A possible solution is to just typedef the struct in question yourself, although this may lead to further related problems as GetCallInfo doesn't seem to be prototyped either. For this you'll need to use GetProcAddress to use the function dynamically with a runtime loaded dll (don't know in which dll GetCallInfo lives so you'll need to find that out). Search this board for examples of the use of GetProcAddress, although it seems msdn provides an example of runtime dynamic linking under the description for that function.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 12-19-2004, 04:32 PM   #3
Registered User
 
Join Date: Sep 2004
Location: California
Posts: 2,845
Are you sure you are including the correct header? My version of NTSecPkg.h (from the SDK) has the structure defined properly. Make sure you are using the header file from the SDK, and not from your compiler.
bithub is offline   Reply With Quote
Old 12-19-2004, 04:55 PM   #4
Registered User
 
Join Date: Dec 2001
Posts: 479
where did you look? i searched for the header it turned out i got 2.

1 "ntsecpkg.h" in dev\include
2 "NTSecPkg.h" in sdk\include

the first one dont have any prototypes at all its full of defined value though

i not sure how to do this runtime dynamic linking either, do you think if i change to msvc it will fix the problem? did anyone have a problem on
msvc?

thanks for the help!
pode is offline   Reply With Quote
Old 12-19-2004, 05:03 PM   #5
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
>>Make sure you are using the header file from the SDK, and not from your compiler.<<

Good idea - it's quicker to test and might just work (wish I'd suggested that ). However, I've found that ms headers are not always compatible with mingw and taking this approach might be more troublesome in the long term.

>>2 "NTSecPkg.h" in sdk\include<<

I think that'll be the one that bithub is referring to.

>>if i change to msvc<<

If that's an option for you then that would seem to be an easier route than fighting it out with dev-cpp (mingw).
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 12-19-2004, 05:13 PM   #6
Registered User
 
Join Date: Dec 2001
Posts: 479
ok i've changed my compiler to vc 6.0 but i included the sdk header now i got 40 errors then, even if i turn of precompiled headers.
have you tried it out?
pode is offline   Reply With Quote
Old 12-19-2004, 05:15 PM   #7
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
>>now i got 40 errors<<

What are they?[edit] (don't post multiple errors that are the same and include the msvc error codes, too).[/edit]
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 12-19-2004, 05:18 PM   #8
Registered User
 
Join Date: Dec 2001
Posts: 479
they are:
Code:
ompiling...
tester.cpp
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(200) : error C2059: syntax error : '__stdcall'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(202) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(207) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(213) : error C2061: syntax error : identifier 'PLSA_STRING'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(215) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(223) : error C2061: syntax error : identifier 'PLSA_STRING'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(226) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(232) : error C2061: syntax error : identifier 'PLSA_STRING'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(233) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(260) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(266) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(274) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(282) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(284) : error C2143: syntax error : missing ';' before '*'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(284) : error C2501: 'PLSA_CREATE_LOGON_SESSION' : missing storage-class or type specifiers
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(303) : error C2146: syntax error : missing ';' before identifier 'CreateLogonSession'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(303) : error C2501: 'PLSA_CREATE_LOGON_SESSION' : missing storage-class or type specifiers
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(303) : error C2501: 'CreateLogonSession' : missing storage-class or type specifiers
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(351) : error C2061: syntax error : identifier 'PLSA_STRING'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(354) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(359) : error C2061: syntax error : identifier 'SECURITY_LOGON_TYPE'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(371) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(376) : error C2061: syntax error : identifier 'SECURITY_LOGON_TYPE'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(389) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(399) : error C2061: syntax error : identifier 'PNTSTATUS'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(400) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(410) : error C2061: syntax error : identifier 'PNTSTATUS'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(411) : error C2091: function returns function
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(433) : error C2065: 'PUNICODE_STRING' : undeclared identifier
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(433) : error C2146: syntax error : missing ')' before identifier 'ClearPassword'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(433) : error C2071: 'PSAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE' : illegal storage class
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(443) : error C2059: syntax error : ')'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(449) : error C2146: syntax error : missing ')' before identifier 'CredentialName'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(449) : error C2071: 'PSAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE' : illegal storage class
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(449) : error C2059: syntax error : ')'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(525) : error C2146: syntax error : missing ';' before identifier 'PackageName'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(525) : error C2501: 'UNICODE_STRING' : missing storage-class or type specifiers
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(525) : error C2501: 'PackageName' : missing storage-class or type specifiers
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(533) : error C2146: syntax error : missing ';' before identifier 'LSA_SEC_HANDLE'
c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h(533) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

tester.exe - 40 error(s), 0 warning(s)
dont know what you meant with
Quote:
(don't post multiple errors that are the same and include the msvc error codes, too).
pode is offline   Reply With Quote
Old 12-19-2004, 05:31 PM   #9
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
When you say you included the sdk header file did you:

1. Use an absolute path, eg. #include "c:\program files\microsoft platform sdk for windows xp sp2\include\ntsecpkg.h"

or

2. Use a more normal #include <ntsecpkg.h> after setting the winxp sp2 sdk path as the initial include path within msvc6?

If you did 1. then go back and recompile after doing 2.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 12-19-2004, 05:41 PM   #10
Banned
 
master5001's Avatar
 
Join Date: Aug 2001
Location: Visalia, CA, USA
Posts: 3,699
Along with what Ken was saying, do you have your compiler configured so that the sdk include directory is in your includes list?
master5001 is offline   Reply With Quote
Old 12-19-2004, 05:43 PM   #11
Registered User
 
Join Date: Dec 2001
Posts: 479
i went to tools\options\directories
and added what you said
it says the directory doesnt exist if i try to do that

edit\\ and yes i had included it before too
pode is offline   Reply With Quote
Old 12-19-2004, 06:12 PM   #12
erstwhile
 
Join Date: Jan 2002
Posts: 2,223
>>it says the directory doesnt exist if i try to do that<<

That's strange. When you add an include directory it should pop up the 'browse for folder' dialog so you can navigate to that directory, then you use the arrow button within that part of the msvc6 options dialog to move that directory to the top of the include directory list. I'm sorry, but I don't understand why you'd get that error...

Unless....

Try a 'build-->clean' then 'build-->rebuild all'.
__________________
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
Ken Fitlike is offline   Reply With Quote
Old 12-19-2004, 07:05 PM   #13
Registered User
 
Join Date: Dec 2001
Posts: 479
nope its not like that cause u only can add folders not entire headerfiles
pode is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alice.... Lurker General Discussions 16 06-20-2005 02:51 PM
Debugging question o_0 C Programming 9 10-10-2004 05:51 PM
Question about pointers #2 maxhavoc C++ Programming 28 06-21-2004 12:52 PM
Question... TechWins A Brief History of Cprogramming.com 16 07-28-2003 09:47 PM
Question, question! oskilian A Brief History of Cprogramming.com 5 12-24-2001 01:47 AM


All times are GMT -6. The time now is 10:48 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22