VirtualBox

Changeset 45318 in vbox for trunk/src


Ignore:
Timestamp:
Apr 3, 2013 5:59:18 PM (12 years ago)
Author:
vboxsync
Message:

grr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp

    r45317 r45318  
    134134                    DWORD      *pdwSize)
    135135{
    136     do
    137     {
    138         AssertMsgBreak(pszDataName, ("Resource name is empty!\n"));
    139 
    140         /* Find our resource. */
    141         HRSRC hRsrc = FindResourceEx(hInst, RT_RCDATA, pszDataName, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
    142         AssertMsgBreak(hRsrc, ("Could not find resource!\n"));
    143 
    144         /* Get resource size. */
    145         *pdwSize = SizeofResource(hInst, hRsrc);
    146         AssertMsgBreak(*pdwSize > 0, ("Size of resource is invalid!\n"));
    147 
    148         /* Get pointer to resource. */
    149         HGLOBAL hData = LoadResource(hInst, hRsrc);
    150         AssertMsgBreak(hData, ("Could not load resource!\n"));
    151 
    152         /* Lock resource. */
    153         *ppvResource = LockResource(hData);
    154         AssertMsgBreak(*ppvResource, ("Could not lock resource!\n"));
    155         return VINF_SUCCESS;
    156 
    157     } while (0);
    158 
    159     return VERR_IO_GEN_FAILURE;
     136    AssertReturn(pszDataName, VERR_INVALID_PARAMETER);
     137
     138    /* Find our resource. */
     139    HRSRC hRsrc = FindResourceEx(hInst, RT_RCDATA, pszDataName, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
     140    AssertReturn(hRsrc, VERR_IO_GEN_FAILURE);
     141
     142    /* Get resource size. */
     143    *pdwSize = SizeofResource(hInst, hRsrc);
     144    AssertReturn(*pdwSize > 0, VERR_NO_DATA);
     145
     146    /* Get pointer to resource. */
     147    HGLOBAL hData = LoadResource(hInst, hRsrc);
     148    AssertReturn(hData, VERR_IO_GEN_FAILURE);
     149
     150    /* Lock resource. */
     151    *ppvResource = LockResource(hData);
     152    AssertReturn(*ppvResource, VERR_IO_GEN_FAILURE);
     153    return VINF_SUCCESS;
    160154}
    161155
     
    696690                            vrc = VERR_NO_CHANGE; /* No change done to the system. */
    697691                        }
    698                         else
    699692                            /** @todo program exit code needs to be for ERROR_INSTALL_USEREXIT. */
    700693                    }
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