CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2011
    Posts
    5

    GetUserNameEx returning 1114

    Hey!
    Ive got an app that authanticates itself through active directory. AD calls like LogonUser() work perfectly, but when i call a GetUserNameEx() it returns a 1114 (ERROR_DLL_INIT_FAILED) error. I cannot see any bad event at my pc or dc's EventViewer, and tried to check dll loads with Process Monitor, but no success. Client is Win7, server is 2003. Another guy works in another project of the same visual studio 2008 solution, and it works perfectly for him. Unfortunately i cant port my part to his pc, because its missing core parts and it wont run there.
    Could it have any problem with Secur32.dll? Any ideas? Any help appriciated, thank you.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: GetUserNameEx returning 1114

    GetUserNameEx returns BOOLEAN (zero if failed, non-zero if succeeded) and not an error code.
    See How to correctly use GetLastError
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Oct 2011
    Posts
    5

    Re: GetUserNameEx returning 1114

    Well, of course it seems like if (getusernameex faild) GetLastError(), and thats what returns the 1114, not the mentioned function itself...

  4. #4
    Join Date
    Oct 2011
    Posts
    5

    Re: GetUserNameEx returning 1114

    Quote Originally Posted by Credo View Post
    faild
    i mean failed

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: GetUserNameEx returning 1114

    ERROR_DLL_INIT_FAILED literally means that some dll has failed to initialize. Typically this happens because of broken dll dependencies, though in your case it might be something more exotic. Try to disable anti-virus software if any and see whether this helps.
    Best regards,
    Igor

  6. #6
    Join Date
    Oct 2011
    Posts
    5

    Re: GetUserNameEx returning 1114

    Quote Originally Posted by Igor Vartanov View Post
    ERROR_DLL_INIT_FAILED literally means that some dll has failed to initialize. Typically this happens because of broken dll dependencies, though in your case it might be something more exotic. Try to disable anti-virus software if any and see whether this helps.
    hey, thx for the answer.
    unfortunately that is not the case. after some testing though, it seems this only happens when i start my app from inside visual studio. when i go to the generated folder and make a shortcut to the exe with the same working directory as the VS startup project, it works. I thought that besides the working dir theres no difference between the two starting mode... now im stuck... Any idea?
    Thx

  7. #7
    Join Date
    Feb 2002
    Posts
    4,640

    Re: GetUserNameEx returning 1114

    The "working directory" can be changed in Visual Studio (somewhere in the project settings), as well as the DLL search path.

    Viggy

  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: GetUserNameEx returning 1114

    unfortunately that is not the case.
    It seems this is exactly the case of dll dependency as long as the working folder or dll search order is the matter.
    Best regards,
    Igor

  9. #9
    Join Date
    Oct 2011
    Posts
    5

    Re: GetUserNameEx returning 1114

    Hey. Thx for answers. The problem has been solved by dummy-calling one of those dll functions at the app startup... then it got it right. Well... at least it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured