[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: Re: [PATCH] Silence an annoying exception in acmMetrics
From: "James Hatheway" <james () macadamian ! com>
Date: 2000-09-29 17:42:41
[Download RAW message or body]
> seeing an exception for a bad hao is not intended by design,
> it's just that I forgot that IsBadReadPtr now relies on exception
> handlers... so, I agree that having an exception popping up for a
> bad parameter is a bad design. anyway, the semantics of
> MSACM_GetObj is:
> from a *valid* hao, get the pointer to the internal struct referred by
> hao (given it's type when needed).
> so, putting the test for NULL hao in MSACM_GetObj doesn't change the
> semantics (it will still return NULL). only difference is that no
> exception will be thrown (since they were not intended, that's even
> better)
> anyway, it's up to the caller of MSACM_GetObj to known if a NULL hao is
> a case of error or not.
OK. Here is the check in MSACM_GetObj instead.
-James
--
James Hatheway
Software Designer - Macadamian Technologies, Inc.
james@macadamian.com ~ http://www.macadamian.com
"Nothing is a problem once you debug the code."
["noexcep_acmMetrics_2.diff" (application/octet-stream)]
Index: dlls/msacm/internal.c
===================================================================
RCS file: /home/wine/wine/dlls/msacm/internal.c,v
retrieving revision 1.4
diff -u -r1.4 internal.c
--- dlls/msacm/internal.c 2000/08/26 04:33:00 1.4
+++ dlls/msacm/internal.c 2000/09/29 17:33:48
@@ -147,7 +147,7 @@
{
PWINE_ACMOBJ pao = (PWINE_ACMOBJ)hObj;
- if (IsBadReadPtr(pao, sizeof(WINE_ACMOBJ)) ||
+ if (pao == NULL || IsBadReadPtr(pao, sizeof(WINE_ACMOBJ)) ||
((type != WINE_ACMOBJ_DONTCARE) && (type != pao->dwType)))
return NULL;
return pao;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic