![]() |
Win32Thread() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Private Function |
Declared in: Win32Thread.h |
Declaration
static DWORD WINAPI Win32Thread(
LPVOID lpData);
DescriptionOur thread proc
Function Body
try
{
//We have ourselves
CWin32Thread* pClass;
pClass=(CWin32Thread*)lpData;
//Indicate we started running
pClass->SetThreadStatus(tsRunning);
//Get our data
LPVOID pData;
pData=pClass->GetData();
//Our threadproc
LPGenericThreadProc lpProc;
lpProc=pClass->GetThreadProc();
//Do we have autodelete (must be set before running thread)
BOOL bAutoDelete;
bAutoDelete=pClass->GetAutoDelete();
//Get the proc return value
DWORD dwReturnValue;
//Protect it
try
{
dwReturnValue=(*lpProc)(pData);
}
catch(...)
{
}
//If we have auto delete then just delete it
if (bAutoDelete)
{
//First close the socket
//We don't need to be like this
pClass->SetBruteTermination(FALSE);
//Now we can delete ourselves
delete pClass;
}
//Check if we need to set the status
else if (dwReturnValue!=THREAD_DO_NOTHING_EXIT_VALUE)
//Indicate we stopped running
pClass->SetThreadStatus(tsStopped);
return dwReturnValue;
}
ERROR_HANDLER_STATIC_RETURN(CWin32Thread_Class,"Win32Thread",THREAD_DO_NOTHING_EXIT_VALUE)
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |