Is it not time to start getting rid of IsBadWritePtr and friends? I don't see a good reason for these in our own code, especially when we can just use SEH directly.
-----Original Message----- From: ros-diffs-bounces@reactos.org [mailto:ros-diffs-bounces@reactos.org] On Behalf Of greatlrd@svn.reactos.org Sent: 13 November 2008 19:52 To: ros-diffs@reactos.org Subject: [ros-diffs] [greatlrd] 37343: Bugfix : Do not link to LPDDRAWI_DIRECTDRAW_INT->lpLink when we do not have any LPDDRAWI_DIRECTDRAW_INT->lpLcl
Author: greatlrd Date: Thu Nov 13 13:52:20 2008 New Revision: 37343
URL: http://svn.reactos.org/svn/reactos?rev=37343&view=rev Log: Bugfix : Do not link to LPDDRAWI_DIRECTDRAW_INT->lpLink when we do not have any LPDDRAWI_DIRECTDRAW_INT->lpLcl
Modified: branches/reactx/reactos/dll/directx/ddraw/startup.c
Modified: branches/reactx/reactos/dll/directx/ddraw/startup.c URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/dll/directx/ddraw... ============================================================================== --- branches/reactx/reactos/dll/directx/ddraw/startup.c [iso-8859-1] (original) +++ branches/reactx/reactos/dll/directx/ddraw/startup.c [iso-8859-1] Thu Nov 13 13:52:20 2008 @@ -33,8 +33,8 @@
This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
- /* fixme linking too second link when we shall not doing it */ - if (IsBadReadPtr(This,sizeof(LPDIRECTDRAW))) + if ( (IsBadWritePtr(This,sizeof(LPDDRAWI_DIRECTDRAW_INT)) != 0) || + (IsBadWritePtr(This->lpLcl,sizeof(LPDDRAWI_DIRECTDRAW_LCL)) != 0) ) { /* We do not have a DirectDraw interface, we need alloc it*/ LPDDRAWI_DIRECTDRAW_INT memThis;
Yes, I agree, we have SEH and we should just use that. Keep IsBadXxxXxx for compatibility reasons only.
On Thu, Nov 13, 2008 at 2:59 PM, gedmurphy gedmurphy@gmail.com wrote:
Is it not time to start getting rid of IsBadWritePtr and friends? I don't see a good reason for these in our own code, especially when we can just use SEH directly.
1. if u warp code with PSEH it can not be optimze with the compiler (acroing KJK when he told me try avoid PSEH, long time ago).
2. This is old code I had lying around, the ddraw.dll was devloper frist in MSVC then port to GCC and reactos build system.
3. If u look how ms ddraw.dll doing their call they using thuse api.
I can rewrite the code later to use PSEH, but I do not known when I have time todo that. at momment I cleaing up my hd with old dx code. I hope within 1-2 month I commit eveything I have lying around for ddraw.dll. I have a girl friend now. so do not expect equal many commit as I use todo, or fast bugfix. Now I will only focuse on reactx when I got some time over.
----- Original Message ----- From: "James Tabor" jimtabor.rosdev@gmail.com To: "ReactOS Development List" ros-dev@reactos.org Sent: Friday, November 14, 2008 10:18 AM Subject: Re: [ros-dev] [ros-diffs] [greatlrd] 37343: Bugfix : Do not link toLPDDRAWI_DIRECTDRAW_INT->lpLink when we do not have anyLPDDRAWI_DIRECTDRAW_INT->lpLcl
Yes, I agree, we have SEH and we should just use that. Keep IsBadXxxXxx for compatibility reasons only.
On Thu, Nov 13, 2008 at 2:59 PM, gedmurphy gedmurphy@gmail.com wrote:
Is it not time to start getting rid of IsBadWritePtr and friends? I don't see a good reason for these in our own code, especially when we can just use SEH directly.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
GBrunmar posted a link to a nice article about IsBadXXXPointer some time ago. Check it out, it's worth reading: "IsBadXxxPtr should really be called CrashProgramRandomly" http://blogs.msdn.com/oldnewthing/archive/2006/09/27/773741.aspx
Best regards, Gregor Schneider
Magnus Olsen wrote:
- if u warp code with PSEH it can not be optimze with the compiler (acroing
KJK when he told me try avoid PSEH, long time ago).
PSEH 2.0 doesn't seem to have this issue (which makes it a little risky to use, maybe?)
I can rewrite the code later to use PSEH, but I do not known when I have time todo that.
just remove the call to IsBadWritePtr. Don't replace it with anything
Only for DirectX api big issue In allot case in dxg.sys or win32k and the graphice drv. They does not vaildate if it vaild pointer or not been pass down it is up to the usermode part vaildate them inside ddraw.dll if I pass down wrong value whole windows xp will crash to black screeen and some part being powerdown. then the comptuer complete froze with nice black screen. How can we vaildate the pointer right in usermode without using IsBadWritePtr and friends I do not known who to solv this issue without using IsBadWritePtr the PSEH or _SEH can not pickup this crash at usermode when it is kmode in the drv or dxg.sys that blows. I have try it today,
The graphic manufactor are aware of this issue but they does not check for all case.
I will not leave detail in public how to make whole xp goes complete dead to nice black screen and some part in the comptuer have been powerdown. It is imposble for me see exacly what crash. I already suffer 10 of this type of crash today.
Yes some parth maybe can be change to SEH the whole HEL layer in ddraw will be use SEH the HAL part in ddraw will not, untill I known a good idea how this issue can be solv on XP.
This Test was done on XP SP3.
----- Original Message ----- From: "KJK::Hyperion" hackbunny@reactos.com To: "ReactOS Development List" ros-dev@reactos.org Sent: Sunday, November 16, 2008 7:32 PM Subject: Re: [ros-dev] [ros-diffs] [greatlrd] 37343: Bugfix : Do not link toLPDDRAWI_DIRECTDRAW_INT->lpLink when we do not have anyLPDDRAWI_DIRECTDRAW_INT->lpLcl
Magnus Olsen wrote:
- if u warp code with PSEH it can not be optimze with the compiler
(acroing KJK when he told me try avoid PSEH, long time ago).
PSEH 2.0 doesn't seem to have this issue (which makes it a little risky to use, maybe?)
I can rewrite the code later to use PSEH, but I do not known when I have time todo that.
just remove the call to IsBadWritePtr. Don't replace it with anything _______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev