VirtualBox

Changeset 30852 in vbox


Ignore:
Timestamp:
Jul 14, 2010 6:16:12 PM (14 years ago)
Author:
vboxsync
Message:

VBox/VMMDev.h: VMMDEV_CREDENTIALS_STRLEN -> VMMDEV_CREDENTIALS_SZ_SIZE; the former was easily confused with what the strlen() returns.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VMMDev.h

    r30758 r30852  
    860860
    861861
    862 /** The length of a string field in the credentials request.
     862/** The size of a string field in the credentials request (including '\\0').
    863863 * @see VMMDevCredentials  */
    864 #define VMMDEV_CREDENTIALS_STRLEN           128
     864#define VMMDEV_CREDENTIALS_SZ_SIZE          128
    865865
    866866/**
     
    877877    uint32_t u32Flags;
    878878    /** OUT: User name (UTF-8). */
    879     char szUserName[VMMDEV_CREDENTIALS_STRLEN];
     879    char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
    880880    /** OUT: Password (UTF-8). */
    881     char szPassword[VMMDEV_CREDENTIALS_STRLEN];
     881    char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
    882882    /** OUT: Domain name (UTF-8). */
    883     char szDomain[VMMDEV_CREDENTIALS_STRLEN];
     883    char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
    884884} VMMDevCredentials;
    885885AssertCompileSize(VMMDevCredentials, 24+4+3*128);
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/Dialog.cpp

    r28800 r30852  
     1/* $Id$ */
    12/** @file
     3 * VBoxGINA - Windows Logon DLL for VirtualBox, Dialog Code.
     4 */
     5
     6/*
    27 *
    3  * VBoxGINA -- Windows Logon DLL for VirtualBox Dialog Code
    4  *
    5  * Copyright (C) 2006-2007 Oracle Corporation
     8 * Copyright (C) 2006-2010 Oracle Corporation
    69 *
    710 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4346#define IDC_WLXWKSTALOCKEDSAS_DOMAIN      1856
    4447
    45 static DLGPROC pfWlxLoggedOutSASDlgProc  = NULL;
    46 
    47 static PWLX_DIALOG_BOX_PARAM pfWlxDialogBoxParam = NULL;
     48static DLGPROC g_pfnWlxLoggedOutSASDlgProc = NULL;
     49
     50static PWLX_DIALOG_BOX_PARAM g_pfnWlxDialogBoxParam = NULL;
    4851
    4952int WINAPI MyWlxDialogBoxParam (HANDLE, HANDLE, LPWSTR, HWND, DLGPROC, LPARAM);
     
    5861        case WLX_VERSION_1_0:
    5962        {
    60             pfWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_0)pWinlogonFunctions)->WlxDialogBoxParam;
     63            g_pfnWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_0)pWinlogonFunctions)->WlxDialogBoxParam;
    6164            ((PWLX_DISPATCH_VERSION_1_0)pWinlogonFunctions)->WlxDialogBoxParam = MyWlxDialogBoxParam;
    6265            break;
     
    6568        case WLX_VERSION_1_1:
    6669        {
    67             pfWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_1)pWinlogonFunctions)->WlxDialogBoxParam;
     70            g_pfnWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_1)pWinlogonFunctions)->WlxDialogBoxParam;
    6871            ((PWLX_DISPATCH_VERSION_1_1)pWinlogonFunctions)->WlxDialogBoxParam = MyWlxDialogBoxParam;
    6972            break;
     
    7275        case WLX_VERSION_1_2:
    7376        {
    74             pfWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_2)pWinlogonFunctions)->WlxDialogBoxParam;
     77            g_pfnWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_2)pWinlogonFunctions)->WlxDialogBoxParam;
    7578            ((PWLX_DISPATCH_VERSION_1_2)pWinlogonFunctions)->WlxDialogBoxParam = MyWlxDialogBoxParam;
    7679            break;
     
    7982        case WLX_VERSION_1_3:
    8083        {
    81             pfWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_3)pWinlogonFunctions)->WlxDialogBoxParam;
     84            g_pfnWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_3)pWinlogonFunctions)->WlxDialogBoxParam;
    8285            ((PWLX_DISPATCH_VERSION_1_3)pWinlogonFunctions)->WlxDialogBoxParam = MyWlxDialogBoxParam;
    8386            break;
     
    8689        case WLX_VERSION_1_4:
    8790        {
    88             pfWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_4)pWinlogonFunctions)->WlxDialogBoxParam;
     91            g_pfnWlxDialogBoxParam = ((PWLX_DISPATCH_VERSION_1_4)pWinlogonFunctions)->WlxDialogBoxParam;
    8992            ((PWLX_DISPATCH_VERSION_1_4)pWinlogonFunctions)->WlxDialogBoxParam = MyWlxDialogBoxParam;
    9093            break;
     
    188191    // Pass on to MSGINA first.
    189192    //
    190     bResult = pfWlxLoggedOutSASDlgProc(hwndDlg, uMsg, wParam, lParam);
     193    bResult = g_pfnWlxLoggedOutSASDlgProc(hwndDlg, uMsg, wParam, lParam);
    191194
    192195    //
     
    303306         {
    304307            Log(("VBoxGINA::MyWlxDialogBoxParam: returning hooked logged out dialog\n"));
    305             pfWlxLoggedOutSASDlgProc = dlgprc;
    306             return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner,
    307                                        MyWlxLoggedOutSASDlgProc, dwInitParam);
     308            g_pfnWlxLoggedOutSASDlgProc = dlgprc;
     309            return g_pfnWlxDialogBoxParam(hWlx, hInst, lpszTemplate, hwndOwner,
     310                                          MyWlxLoggedOutSASDlgProc, dwInitParam);
    308311         }
    309312      }
     
    313316   // The rest will not be redirected.
    314317   //
    315    return pfWlxDialogBoxParam(hWlx, hInst, lpszTemplate,
    316                               hwndOwner, dlgprc, dwInitParam);
     318   return g_pfnWlxDialogBoxParam(hWlx, hInst, lpszTemplate,
     319                                 hwndOwner, dlgprc, dwInitParam);
    317320}
     321
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/Dialog.h

    r28800 r30852  
    11/** @file
    2  *
    3  * VBoxGINA -- Windows Logon DLL for VirtualBox Dialog code
    4  *
    5  * Copyright (C) 2006-2007 Oracle Corporation
     2 * VBoxGINA - Windows Logon DLL for VirtualBox, Dialog Header.
     3 */
     4
     5/*
     6 * Copyright (C) 2006-2010 Oracle Corporation
    67 *
    78 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1415 */
    1516
    16 #ifndef __H_GINADIALOG
    17 #define __H_GINADIALOG
     17#ifndef ___H_GINADIALOG
     18#define ___H_GINADIALOG
    1819
    1920void hookDialogBoxes(PVOID pWinlogonFunctions, DWORD dwWlxVersion);
    2021
    21 #endif /* __H_GINADIALOG */
     22#endif /* !___H_GINADIALOG */
     23
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp

    r28800 r30852  
    2424
    2525/* the credentials */
    26 wchar_t g_Username[VMMDEV_CREDENTIALS_STRLEN];
    27 wchar_t g_Password[VMMDEV_CREDENTIALS_STRLEN];
    28 wchar_t g_Domain[VMMDEV_CREDENTIALS_STRLEN];
     26wchar_t g_Username[VMMDEV_CREDENTIALS_SZ_SIZE];
     27wchar_t g_Password[VMMDEV_CREDENTIALS_SZ_SIZE];
     28wchar_t g_Domain[VMMDEV_CREDENTIALS_SZ_SIZE];
    2929
    3030
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.h

    r28800 r30852  
    11/** @file
    2  *
    3  * VBoxGINA -- Windows Logon DLL for VirtualBox Helper Functions
    4  *
    5  * Copyright (C) 2006-2007 Oracle Corporation
     2 * VBoxGINA - Windows Logon DLL for VirtualBox, Helper Functions.
     3 */
     4
     5/*
     6 * Copyright (C) 2006-2010 Oracle Corporation
    67 *
    78 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1415 */
    1516
    16 #ifndef __H_GINAHELPER
    17 #define __H_GINAHELPER
     17#ifndef ___H_GINAHELPER
     18#define ___H_GINAHELPER
    1819
    1920#include <iprt/thread.h>
     
    3132bool credentialsPollerTerminate(void);
    3233
    33 #endif /* __H_GINAHELPER */
     34#endif /* !___H_GINAHELPER */
     35
  • trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.h

    r28800 r30852  
    11/** @file
    2  *
    3  * VBoxGINA -- Windows Logon DLL for VirtualBox
    4  *
    5  * Copyright (C) 2006-2007 Oracle Corporation
     2 * VBoxGINA - Windows Logon DLL for VirtualBox.
     3 */
     4
     5/*
     6 * Copyright (C) 2006-2010 Oracle Corporation
    67 *
    78 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1415 */
    1516
    16 #ifndef __H_VBOXGINA
    17 #define __H_VBOXGINA
     17#ifndef ___H_VBOXGINA
     18#define ___H_VBOXGINA
    1819
    1920#include <iprt/initterm.h>
    20 #include <iprt/log.h>
    21 
    22 #include <VBox/Log.h>
     21#include <VBox/log.h>
    2322
    2423/** Handle to Winlogon service */
     
    2827
    2928
    30 /**
    31  * GINA entry point calls
     29/** @name GINA entry point calls
     30 * @{
    3231 */
    3332typedef BOOL (WINAPI *PGWLXNEGOTIATE)(DWORD, DWORD*);
     
    5655typedef VOID (WINAPI *PGWLXRECONNECTNOTIFY)(PVOID);
    5756typedef VOID (WINAPI *PGWLXDISCONNECTNOTIFY)(PVOID);
     57/** @}  */
    5858
     59#endif /* !___H_VBOXGINA */
    5960
    60 
    61 #endif /* __H_VBOXGINA */
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r30850 r30852  
    16311631
    16321632                /* let's start by nulling out the data */
    1633                 memset(credentials->szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1634                 memset(credentials->szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1635                 memset(credentials->szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1633                memset(credentials->szUserName, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1634                memset(credentials->szPassword, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1635                memset(credentials->szDomain, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
    16361636
    16371637                /* should we return whether we got credentials for a logon? */
     
    16701670                    if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEAR)
    16711671                    {
    1672                         memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1673                         memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1674                         memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1672                        memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1673                        memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1674                        memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
    16751675                    }
    16761676                }
     
    16901690                if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEARJUDGE)
    16911691                {
    1692                     memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1693                     memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    1694                     memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     1692                    memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1693                    memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     1694                    memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
    16951695                }
    16961696
     
    26822682    if (!pThis->fKeepCredentials)
    26832683    {
    2684         memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2685         memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2686         memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2687     }
    2688     memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2689     memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
    2690     memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
     2684        memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     2685        memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     2686        memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     2687    }
     2688    memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     2689    memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
     2690    memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_SZ_SIZE);
    26912691
    26922692    /* Reset means that additions will report again. */
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r30850 r30852  
    6565    struct
    6666    {
    67         char szUserName[VMMDEV_CREDENTIALS_STRLEN];
    68         char szPassword[VMMDEV_CREDENTIALS_STRLEN];
    69         char szDomain[VMMDEV_CREDENTIALS_STRLEN];
     67        char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
     68        char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
     69        char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
    7070        bool fAllowInteractiveLogon;
    7171    } Logon;
     
    7474    struct
    7575    {
    76         char szUserName[VMMDEV_CREDENTIALS_STRLEN];
    77         char szPassword[VMMDEV_CREDENTIALS_STRLEN];
    78         char szDomain[VMMDEV_CREDENTIALS_STRLEN];
     76        char szUserName[VMMDEV_CREDENTIALS_SZ_SIZE];
     77        char szPassword[VMMDEV_CREDENTIALS_SZ_SIZE];
     78        char szDomain[VMMDEV_CREDENTIALS_SZ_SIZE];
    7979    } Judge;
    8080} VMMDEVCREDS;
Note: See TracChangeset for help on using the changeset viewer.

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