Re: InitializeCriticalSection code in kernel
- From: "yash" <yash.anand@xxxxxxxxx>
- Date: 27 Dec 2006 04:00:32 -0800
Hello All,
I am sorry but I was out of action for a long time now due to an
injury.
We did a small exercise going by the discussion we are having.
We wrote a small application in WinCE 5.0. The application does nothing
more than just declaring a variable of the type CRITICAL_SECTION and
then we put a small loop which keeps calling the
IntialiseCriticalSection repeatedly. After calling the same for about
~422291 times the message box shows "Not enough memory". The OS does
not respond after this.
I think this exercise brings out the purpose of my initial mail.
I am copying the code at the bottom.
Regards
Yash
==================================================
// critical.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "critical.h"
#include <commctrl.h>
void createcritical();
CRITICAL_SECTION m_Lock;
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
createcritical();
return 0;
}
void createcritical()
{
UINT i=0;
do
{
InitializeCriticalSection(&m_Lock);
RETAILMSG(1,(TEXT("i=%u\n"),i));
}while(++i);
}
==================================================
Sue Loh [MS] wrote:
It isn't really clear to me what you mean, that anyone can crash the system
using IPCs. Could you get more specific? Generally our goal is that low
privilege apps can crash themselves but nobody else, while high privilege
code could probably bring down the system.
Sue
sloh@xxxxxxxxxxxxx (remove "online" from reply-to address)
http://blogs.msdn.com/ce_base/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________
.
- Prev by Date: led driver in wince5.0
- Next by Date: Re: USB Mass Storage Device ( Not able to open the drive)
- Previous by thread: led driver in wince5.0
- Next by thread: Re: Platform Builder for CE 6.0 Installation
- Index(es):
Relevant Pages
|