VirtualBox

Changeset 27576 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 22, 2010 9:39:11 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59101
Message:

IPRT/testcase: Added logon failure error, test some more stuff.

Location:
trunk/src/VBox/Runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r27503 r27576  
    10231023VBoxRT_LIBS.win                = \
    10241024        $(PATH_SDK_W2K3DDK_LIB)/vccomsup.lib \
    1025         $(PATH_SDK_W2K3DDK_LIB)/wbemuuid.lib \
    1026         $(PATH_SDK_W2K3DDK_LIB)/Userenv.lib
     1025        $(PATH_SDK_W2K3DDK_LIB)/wbemuuid.lib
    10271026VBoxRT_LDFLAGS.darwin          = -framework IOKit -framework CoreFoundation -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
    10281027ifdef VBOX_USE_VCC80
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r27439 r27576  
    394394tstRTProcCreateEx_TEMPLATE = VBOXR3TSTEXE
    395395tstRTProcCreateEx_SOURCES = tstRTProcCreateEx.cpp
    396 tstRTProcCreateEx_LIBS.win += Secur32.lib
    397396
    398397tstRTProcWait_SOURCES = tstRTProcWait.cpp
  • trunk/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp

    r27555 r27576  
    8383
    8484#ifdef RT_OS_WINDOWS
    85 # if 0 /** @todo Something here drags in Secur32.dll and prevents the testcase from being run on NT4. Add this stuff to IPRT and dynamically resolve the problematic bits, please. */
    8685    char szUser[_1K];
    8786    DWORD cbLen = sizeof(szUser);
    8887    /** @todo Does not yet handle ERROR_MORE_DATA for user names longer than 32767. */
    89     if (!GetUserNameEx(NameSamCompatible, szUser, &cbLen))
    90     {
    91         RTPrintf("GetUserNameEx failed with last error=%ld\n", GetLastError());
     88    if (!GetUserName(szUser, &cbLen))
     89    {
     90        RTPrintf("GetUserName failed with last error=%ld\n", GetLastError());
    9291        return VERR_AUTHENTICATION_FAILURE;
    9392    }
    9493    else
    9594    {
     95/* Does not work on NT4 (yet). */
     96#if 0
    9697        DWORD cbSid = 0;
    9798        DWORD cbDomain = 0;
     
    134135        RTMemFree(pSid);
    135136        RTMemFree(pszDomain);
    136     }
    137 # endif
     137#endif
     138    }
    138139#else
    139140    /** @todo Lookup UID/effective UID, maybe GID? */
     
    154155
    155156    RTPROCESS hProc;
     157
     158    /* Test for invalid logons. */
     159    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, 0 /*fFlags*/, NULL,
     160                                         NULL, NULL, "not-existing-user", "wrong-password", &hProc), VERR_LOGON_FAILURE);
     161    /* Test for invalid application. */
     162    RTTESTI_CHECK_RC_RETV(RTProcCreateEx("not-existing-app", apszArgs, RTENV_DEFAULT, 0 /*fFlags*/, NULL,
     163                                         NULL, NULL, NULL, NULL, &hProc), VERR_PATH_NOT_FOUND);
     164    /* Test a (hopefully) valid user/password logon (given by parameters of this function). */
    156165    RTTESTI_CHECK_RC_RETV(RTProcCreateEx(g_szExecName, apszArgs, RTENV_DEFAULT, 0 /*fFlags*/, NULL,
    157166                                         NULL, NULL, pszUser, pszPassword, &hProc), VINF_SUCCESS);
     
    164173        RTTestIPassed(NULL);
    165174}
    166 
     175   
    167176
    168177static int tstRTCreateProcEx4Child(int argc, char **argv)
     
    422431            return 99;
    423432        pszAsUser   = argv[2];
    424         pszPassword = argv[4];
     433        pszPassword = argv[3];
    425434    }
    426435
     
    442451    tstRTCreateProcEx4();
    443452    if (pszAsUser)
    444     {
    445         /** @todo Do not run tstRTCreateProcEx5 on NT4, may not work (?) */
    446453        tstRTCreateProcEx5(pszAsUser, pszPassword);
    447     }
    448454    /** @todo Cover files, ++ */
    449455
  • trunk/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp

    r26344 r27576  
    191191        case ERROR_CANCELLED:               return VERR_CANCELLED;
    192192        case ERROR_DIRECTORY:               return VERR_NOT_A_DIRECTORY;
     193
     194        case ERROR_LOGON_FAILURE:           return VERR_LOGON_FAILURE;
    193195
    194196        /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette