Question..

This is a discussion on Question.. within the Windows Programming forums, part of the Platform Specific Boards category; hi, i'm having a problem with a structure i found at MSDN. the problem is that the complielr doesnt seem ...

  1. #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?

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    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.

  4. #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!

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>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.

  6. #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?

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>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.

  8. #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
    (don't post multiple errors that are the same and include the msvc error codes, too).

  9. #9
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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.

  10. #10
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Along with what Ken was saying, do you have your compiler configured so that the sdk include directory is in your includes list?

  11. #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

  12. #12
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>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.

  13. #13
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    nope its not like that cause u only can add folders not entire headerfiles

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 03:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 06:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 01:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM

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