VirtualBox

Changeset 29248 in vbox


Ignore:
Timestamp:
May 9, 2010 5:18:13 PM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl2.cpp: some cleanup, hope it compiles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r29227 r29248  
    105105# include "IOKit/IOKitLib.h"
    106106
    107 int DarwinSmcKey(char* aKey, uint32_t iKeySize)
     107static int DarwinSmcKey(char *aKey, uint32_t iKeySize)
    108108{
    109109    /*
     
    122122    } AppleSMCBuffer;
    123123
    124 
    125     if (iKeySize < 65)
    126         return VERR_INTERNAL_ERROR;
     124    AssertReturn(iKeySize >= 65, VERR_INTERNAL_ERROR;
    127125
    128126    io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault,
     
    131129        return VERR_INTERNAL_ERROR;
    132130
    133     io_connect_t port = (io_connect_t)0;
    134     kern_return_t kr = IOServiceOpen(service, mach_task_self(), 0, &port);
     131    io_connect_t    port = (io_connect_t)0;
     132    kern_return_t   kr  = IOServiceOpen(service, mach_task_self(), 0, &port);
    135133    IOObjectRelease(service);
    136134
     
    138136        return VERR_INTERNAL_ERROR;
    139137
    140     AppleSMCBuffer inputStruct = { 0, {0}, 32, {0}, 5, }, outputStruct;
    141     size_t outputStructCnt = sizeof(outputStruct);
     138    AppleSMCBuffer  inputStruct    = { 0, {0}, 32, {0}, 5, };
     139    AppleSMCBuffer  outputStruct;
     140    size_t          cbOutputStruct = sizeof(outputStruct);
    142141
    143142    for (int i = 0; i < 2; i++)
     
    146145        kr = IOConnectCallStructMethod((mach_port_t)port,
    147146                                       (uint32_t)2,
    148                                        (const void*)&inputStruct,
     147                                       (const void *)&inputStruct,
    149148                                       sizeof(inputStruct),
    150                                        (void*)&outputStruct,
    151                                        &outputStructCnt);
     149                                       (void *)&outputStruct,
     150                                       &cbOutputStruct);
    152151        if (kr != kIOReturnSuccess)
    153152        {
     
    156155        }
    157156
    158         for (int j=0; j<32; j++)
     157        for (int j = 0; j < 32; j++)
    159158            aKey[j + i*32] = outputStruct.data[j];
    160159    }
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