Results 1 to 12 of 12

Thread: LogonUser Returns 0 in NT

  1. #1
    spetnik
    Guest

    LogonUser Returns 0 in NT

    Why does logonuser return 0 in Windows NT???

  2. #2
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    is there a user logged on when you call the function?
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  3. #3
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Zero means the call to Logonuser failed. Check the following demo to make sure your calling it correctly.

    Demo of LogonUser

  4. #4
    spetnik
    Guest
    I am entering the correct info, and the code i copied from a sample. but I'll try urs and see. thanx

  5. #5
    spetnik
    Guest
    nope, it doesn't work

  6. #6
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    So there is no user logged on when you call it?

    try this: use getlasterror (an API) and see what it returns, then look it up on MSDN
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  7. #7
    Fanatic Member Patoooey's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, USA
    Posts
    774
    Hmmmm.....NT logs on fine otherwise......your program has correct permissions to run.....Domain specified ?? Try without to check username(see below link)

    Only other sample I can find uses the LastDllError mentioned in previous post.

    http://www.vbusers.com/code/codeget....1&NumReplies=3

    Above link has 2 functions for checking if username/password valid. Says one is more reliable then other.

  8. #8
    spetnik
    Guest
    Originally posted by mlewis
    So there is no user logged on when you call it?

    try this: use getlasterror (an API) and see what it returns, then look it up on MSDN
    hmmm, 0. a very common error

  9. #9
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    Hmm...
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  10. #10
    spetnik
    Guest
    Originally posted by Patoooey
    Hmmmm.....NT logs on fine otherwise......your program has correct permissions to run.....Domain specified ?? Try without to check username(see below link)

    Only other sample I can find uses the LastDllError mentioned in previous post.

    http://www.vbusers.com/code/codeget....1&NumReplies=3

    Above link has 2 functions for checking if username/password valid. Says one is more reliable then other.

    hmm, it seems i do not have rites for logonuser. o well

  11. #11
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    mlewis - Set us up the bomb!
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  12. #12
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    I condog...or is that concur?
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

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