Click here to Skip to main content
15,888,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: switch (string) Pin
Manfr3d15-Mar-08 2:21
Manfr3d15-Mar-08 2:21 
QuestionHow to set bitmap image as Background of RichEdit on WIN32 API? Pin
sawerset14-Mar-08 9:21
sawerset14-Mar-08 9:21 
QuestionNeed to access a VB.Net DLL in VC++ Pin
abiemann14-Mar-08 9:21
abiemann14-Mar-08 9:21 
GeneralRe: Need to access a VB.Net DLL in VC++ Pin
CPallini14-Mar-08 10:58
mveCPallini14-Mar-08 10:58 
GeneralRe: Need to access a VB.Net DLL in VC++ Pin
abiemann14-Mar-08 12:15
abiemann14-Mar-08 12:15 
GeneralRe: Need to access a VB.Net DLL in VC++ Pin
abiemann14-Mar-08 12:27
abiemann14-Mar-08 12:27 
GeneralDetermine Location of a Variable Pin
Jeffrey Walton14-Mar-08 4:28
Jeffrey Walton14-Mar-08 4:28 
GeneralRe: Determine Location of a Variable PinPopular
Randor 14-Mar-08 12:05
professional Randor 14-Mar-08 12:05 
Im feeling generous again today! So I modified your function. I am using an undocumented technique here! Its a hack!

BOOL InsideStackHack(LPVOID p)
{
	PVOID pStackTop = NULL;
	PVOID pStackBottom = NULL;
	__asm
	{
		push    eax
		push    ebx
		mov     ebx,fs:[18h]
		mov     eax,dword ptr [ebx+4h]
		mov     pStackTop, eax
		mov     eax,dword ptr [ebx+0xe0c] //Undocumented... probably subject to change! -David Delaune
		mov     pStackBottom, eax
		pop     eax
		pop     ebx
	}
	return (pStackBottom < p && p <= pStackTop);
}


Perhaps you would rather use my second creation, this one is not quite as hacktastic.

BOOL InsideStackNoHack(LPVOID p)
{
	PNT_TIB lTeb = (PNT_TIB)NtCurrentTeb();
	PVOID pStackTop = lTeb->StackBase;
	MEMORY_BASIC_INFORMATION MemoryBasicInformation;
	VirtualQueryEx(GetCurrentProcess(),p,&MemoryBasicInformation, sizeof MemoryBasicInformation);
	PVOID pStackBottom = MemoryBasicInformation.AllocationBase;
	return (pStackBottom < p && p <= pStackTop);
}


Good Luck,
-David Delaune
GeneralRe: Determine Location of a Variable Pin
Jeffrey Walton14-Mar-08 22:53
Jeffrey Walton14-Mar-08 22:53 
GeneralMultiple text lines and ellipsis? [modified] Pin
Moak14-Mar-08 3:27
Moak14-Mar-08 3:27 
QuestionRe: Multiple text lines and ellipsis? Pin
Rajkumar R14-Mar-08 3:46
Rajkumar R14-Mar-08 3:46 
GeneralRe: Multiple text lines and ellipsis? Pin
Moak14-Mar-08 4:01
Moak14-Mar-08 4:01 
QuestionRe: Multiple text lines and ellipsis? Pin
David Crow14-Mar-08 5:38
David Crow14-Mar-08 5:38 
GeneralRe: Multiple text lines and ellipsis? Pin
Moak14-Mar-08 6:42
Moak14-Mar-08 6:42 
GeneralRe: Multiple text lines and ellipsis? Pin
David Crow14-Mar-08 6:50
David Crow14-Mar-08 6:50 
GeneralRe: Multiple text lines and ellipsis? Pin
led mike14-Mar-08 7:49
led mike14-Mar-08 7:49 
GeneralRe: Multiple text lines and ellipsis? Pin
Moak15-Mar-08 10:08
Moak15-Mar-08 10:08 
GeneralHRESULT function confusion Pin
rowdy_vc++14-Mar-08 3:07
rowdy_vc++14-Mar-08 3:07 
GeneralRe: HRESULT function confusion Pin
CPallini14-Mar-08 3:47
mveCPallini14-Mar-08 3:47 
GeneralRe: HRESULT function confusion Pin
Rajesh R Subramanian14-Mar-08 8:13
professionalRajesh R Subramanian14-Mar-08 8:13 
GeneralExporting entry points in a dll with classes Pin
Klive814-Mar-08 2:58
Klive814-Mar-08 2:58 
GeneralRe: Exporting entry points in a dll with classes Pin
David Crow14-Mar-08 3:02
David Crow14-Mar-08 3:02 
Generalpath via property sheet Pin
john563214-Mar-08 2:46
john563214-Mar-08 2:46 
QuestionChrash at UpdateData(FALSE) Pin
merh14-Mar-08 2:45
merh14-Mar-08 2:45 
GeneralRe: Chrash at UpdateData(FALSE) Pin
Cedric Moonen14-Mar-08 3:03
Cedric Moonen14-Mar-08 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.