mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
- Add SEH protection for FindResourceExW
Notepad++ works now svn path=/trunk/; revision=39531
This commit is contained in:
parent
f9586906e9
commit
6ad6909fad
1 changed files with 22 additions and 13 deletions
|
@ -1197,21 +1197,30 @@ FindResourceExW (
|
|||
if ( hModule == NULL )
|
||||
hModule = (HINSTANCE)GetModuleHandleW(NULL);
|
||||
|
||||
if ( !IS_INTRESOURCE(lpName) && lpName[0] == L'#' ) {
|
||||
lpName = MAKEINTRESOURCEW(wcstoul(lpName + 1, NULL, 10));
|
||||
}
|
||||
if ( !IS_INTRESOURCE(lpType) && lpType[0] == L'#' ) {
|
||||
lpType = MAKEINTRESOURCEW(wcstoul(lpType + 1, NULL, 10));
|
||||
}
|
||||
_SEH2_TRY
|
||||
{
|
||||
if ( !IS_INTRESOURCE(lpName) && lpName[0] == L'#' ) {
|
||||
lpName = MAKEINTRESOURCEW(wcstoul(lpName + 1, NULL, 10));
|
||||
}
|
||||
if ( !IS_INTRESOURCE(lpType) && lpType[0] == L'#' ) {
|
||||
lpType = MAKEINTRESOURCEW(wcstoul(lpType + 1, NULL, 10));
|
||||
}
|
||||
|
||||
ResourceInfo.Type = (ULONG)lpType;
|
||||
ResourceInfo.Name = (ULONG)lpName;
|
||||
ResourceInfo.Language = (ULONG)wLanguage;
|
||||
ResourceInfo.Type = (ULONG)lpType;
|
||||
ResourceInfo.Name = (ULONG)lpName;
|
||||
ResourceInfo.Language = (ULONG)wLanguage;
|
||||
|
||||
Status = LdrFindResource_U (hModule,
|
||||
&ResourceInfo,
|
||||
RESOURCE_DATA_LEVEL,
|
||||
&ResourceDataEntry);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
Status = LdrFindResource_U (hModule,
|
||||
&ResourceInfo,
|
||||
RESOURCE_DATA_LEVEL,
|
||||
&ResourceDataEntry);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
|
|
Loading…
Reference in a new issue