Ignore:
Timestamp:
Nov 29, 1999, 1:05:03 AM (26 years ago)
Author:
bird
Message:

Implemented EnumResourceNamesA/W.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/resource.cpp

    r956 r1872  
    1 /* $Id: resource.cpp,v 1.9 1999-09-15 23:38:01 sandervl Exp $ */
     1/* $Id: resource.cpp,v 1.10 1999-11-29 00:04:05 bird Exp $ */
    22
    33/*
     
    2727
    2828    dprintf(("FindResourceA %X", hModule));
    29     if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule ==
    30        WinExe->getInstanceHandle()))
    31     {
    32          module = (Win32ImageBase *)WinExe;
    33     }
    34     else module = (Win32ImageBase *)Win32DllBase::findModule(hModule);
    35 
     29    module = Win32ImageBase::findModule(hModule);
    3630    if(module == NULL)
    37         return(NULL);
     31      return(NULL);
    3832
    3933    return module->findResourceA(lpszName, (LPSTR)lpszType);
     
    4236//******************************************************************************
    4337HRSRC WIN32API FindResourceW(HINSTANCE hModule, LPCWSTR lpszName,
    44                              LPCWSTR lpszType)
     38                          LPCWSTR lpszType)
    4539{
    4640 Win32ImageBase *module;
    4741
    4842    dprintf(("FindResourceW %X", hModule));
    49     if(hModule == 0 || hModule == -1 || (WinExe != NULL && hModule ==
    50        WinExe->getInstanceHandle()))
    51     {
    52          module = (Win32ImageBase *)WinExe;
    53     }
    54     else module = (Win32ImageBase *)Win32DllBase::findModule(hModule);
    55 
     43    module = Win32ImageBase::findModule(hModule);
    5644    if(module == NULL)
    57         return(NULL);
     45        return(NULL);
    5846
    5947    return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType);
     
    7765  /* @@@PH */
    7866  if (HIWORD(res) == NULL) {
    79         dprintf(("LoadResource %x: invalid hRes %x", hModule, hRes));
    80         return 0;
     67   dprintf(("LoadResource %x: invalid hRes %x", hModule, hRes));
     68   return 0;
    8169  }
    8270  else  return (HGLOBAL)res->lockResource();
     
    9684}
    9785//******************************************************************************
    98 //******************************************************************************
    99 BOOL WIN32API EnumResourceNamesA(HINSTANCE hModule, LPCTSTR lpszType,
    100                     ENUMRESNAMEPROCA lpEnumFunc, LONG lParam)
     86
     87
     88
     89/**
     90 * The EnumResourceNames function searches a module for each
     91 * resource of the specified type and passes the name of each
     92 * resource it locates to an application-defined callback function
     93 *
     94 * @returns  If the function succeeds, the return value is nonzero.
     95 *           If the function fails, the return value is zero
     96 * @param    hModule       resource-module handling
     97 * @param    lpszType      pointer to resource type
     98 * @param    lpEnumFunc    pointer to callback function
     99 * @param    lParam        application-defined parameter
     100 * @status   stub
     101 * @author   knut st. osmundsen
     102 * @remark   The EnumResourceNames function continues to enumerate resource
     103 *           names until the callback function returns FALSE or all resource
     104 *           names have been enumerated
     105 */
     106BOOL WIN32API EnumResourceNamesA(HINSTANCE        hModule,
     107                                 LPCTSTR          lpszType,
     108                                 ENUMRESNAMEPROCA lpEnumFunc,
     109                                 LONG             lParam)
    101110{
    102     dprintf(("OS2EnumResourceNamesA - stub\n"));
    103     return(FALSE);
     111    Win32ImageBase *pModule;
     112
     113    dprintf(("KERNEL32:EnumResourceNamesA(%08x,%08x,%08x,%08x) not implemented\n",
     114              hModule, lpszType, lpEnumFunc, lParam
     115             ));
     116
     117    pModule = Win32ImageBase::findModule(hModule);
     118    if (pModule == NULL)
     119    {
     120        SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
     121        return FALSE;
     122    }
     123
     124    return pModule->enumResourceNamesA(hModule, lpszType, lpEnumFunc, lParam);
    104125}
    105 //******************************************************************************
    106 //******************************************************************************
     126
     127
     128/**
     129 * The EnumResourceNames function searches a module for each
     130 * resource of the specified type and passes the name of each
     131 * resource it locates to an application-defined callback function
     132 *
     133 * @returns  If the function succeeds, the return value is nonzero.
     134 *           If the function fails, the return value is zero
     135 * @param    hModule       resource-module handling
     136 * @param    lpszType      pointer to resource type
     137 * @param    lpEnumFunc    pointer to callback function
     138 * @param    lParam        application-defined parameter
     139 * @status   stub
     140 * @author   knut st. osmundsen
     141 * @remark   The EnumResourceNames function continues to enumerate resource
     142 *           names until the callback function returns FALSE or all resource
     143 *           names have been enumerated
     144 */
     145BOOL WIN32API EnumResourceNamesW(HMODULE          hModule,
     146                                 LPCWSTR          lpszType,
     147                                 ENUMRESNAMEPROCW lpEnumFunc,
     148                                 LONG             lParam)
     149{
     150    Win32ImageBase *pModule;
     151
     152    dprintf(("KERNEL32:EnumResourceNamesW(%08x,%08x,%08x,%08x)\n",
     153              hModule, lpszType, lpEnumFunc, lParam));
     154
     155    pModule = Win32ImageBase::findModule(hModule);
     156    if (pModule == NULL)
     157    {
     158        SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
     159        return FALSE;
     160    }
     161
     162    return pModule->enumResourceNamesW(hModule, lpszType, lpEnumFunc, lParam);
     163}
     164
Note: See TracChangeset for help on using the changeset viewer.