X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f NNTP-Posting-Date: Thu, 25 Jul 2013 19:04:26 -0500 From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp References: <788e2b72-ab43-4ae4-8401-97db486d2615 AT googlegroups DOT com> Subject: Re: Beta Test: CWSDPMI r7 - 4GB support Date: Thu, 25 Jul 2013 19:04:22 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Message-ID: <_LednZbOz8-XIGzMnZ2dnUVZ_tednZ2d@earthlink.com> Lines: 28 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 64.91.136.221 X-Trace: sv3-mNiKlNjc6LJsLeIuM98pYAgC71Y8iFrWgBSUz3Bl/lqnaWdTokMH0QXM7NhwB8Ej2oP5HkuYyWCVPaG!Rlwq6lW26aIADmfeNnho3YOgW/kzWuOSeB8zXcnzQYoZpCIFiQEUJ8SHaqlE4Bkpevof7YNe3rq0!qhACi0/ELDzDHpOb9uWI6Q5bY2V8Wf8K X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 2608 X-Original-Bytes: 2547 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com >"Georg Potthast" wrote in message >news:788e2b72-ab43-4ae4-8401-97db486d2615 AT googlegroups DOT com... >I have a question which I do not know if this related to CWSDPMI. I develop >my programs in a Windows XP DOS box and they >work fine there. When I then >try them in real mode DOS they crash due to uninitialized pointers. So I >have to work through the >program again and fix that. But some of these >problems I may not find and my users observe crashes. >Does Windows DPMI set the allocated memory to zero for you while CWSDPMI >does not? Then a "char* mystring;" is set to >NULL by Windows. CWSDPMI does not initialize the memory (to improve performance). On a single process system, there is no need to do this if the program is properly written (no security issues leaking data). To find these pointers (or to simply fix it), DJGPP has two features which allow you to fill the memory, see crt0.h: /* If set, fill sbrk()'d memory with a constant value. If not, memory ** gets whatever happens to have been in there, which breaks some ** applications. */ #define _CRT0_FLAG_FILL_SBRK_MEMORY 0x0020 /* If set, fill memory (above) with 0xdeadbeef, else fill with zero. ** This is especially useful for debugging uninitialized memory problems. */ #define _CRT0_FLAG_FILL_DEADBEEF 0x0040