Ignore:
Timestamp:
Jan 7, 2000, 1:24:34 AM (26 years ago)
Author:
sandervl
Message:

GetMenuStringA bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/winmenu.cpp

    r2318 r2350  
    1 /* $Id: winmenu.cpp,v 1.9 2000-01-04 19:53:45 sandervl Exp $ */
     1/* $Id: winmenu.cpp,v 1.10 2000-01-07 00:24:34 sandervl Exp $ */
    22
    33/*
     
    415415ODINFUNCTION5(int,   GetMenuStringA,
    416416              HMENU, hMenu,
    417               UINT,  arg2,
    418               LPSTR, arg3,
    419               int,   arg4,
    420               UINT,  arg5)
    421 {
    422     if(hMenu == 0)
    423     {
    424         SetLastError(ERROR_INVALID_PARAMETER);
    425         return 0;
    426     }
    427 
    428     return O32_GetMenuString(hMenu, arg2, arg3, arg4, arg5);
     417              UINT,  idItem,
     418              LPSTR, lpsz,
     419              int,   cchMax,
     420              UINT,  fuFlags)
     421{
     422 int rc, nritems;
     423
     424    if(hMenu == 0)
     425    {
     426        SetLastError(ERROR_INVALID_PARAMETER);
     427        return 0;
     428    }
     429    if(!lpsz || !cchMax) {//determine menu string length
     430        char menustr[256];
     431        rc = O32_GetMenuString(hMenu, idItem, menustr, sizeof(menustr), fuFlags);
     432        //SvL: Open32 returns the wrong error
     433        return (rc == -1) ? 0 : rc;
     434    }
     435    rc = O32_GetMenuString(hMenu, idItem, lpsz, cchMax, fuFlags);
     436    //SvL: Open32 returns the wrong error
     437    return (rc == -1) ? 0 : rc;
    429438}
    430439//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.