예전에 썻던 글인데, 누가 reference 로 달아놨다.

http://portal.acm.org/citation.cfm?id=1368510

여기의 reference 중, 30번.

Rodream, One Possible Way to Avoid UAC in Windows Vista, 2007. http://www.rootkit.com/newsread.php?newsid=773

나도 ACM에 글을 얼른 실어야 할텐데!!
__global__ void incKernel(int *g_out, int *g_in, int N, int inner_reps)
00402070  push        ebp  
00402071  mov         ebp,esp 
00402073  mov         eax,dword ptr [__cuda_3] 
00402076  push        eax  
00402077  mov         ecx,dword ptr [__cuda_2] 
0040207A  push        ecx  
0040207B  mov         edx,dword ptr [__cuda_1] 
0040207E  push        edx  
0040207F  mov         eax,dword ptr [__cuda_0] 
00402082  push        eax  
00402083  call        __device_stub__Z9incKernelPiS_ii (401FE0h) 
00402088  add         esp,10h 
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if( idx < N ) {
        for( int i=0; i<inner_reps; ++i ) {        
            //g_out[idx] = g_in[idx] + 1;      
g_out[idx] = i+1;
        }
    }
}
0040208B  pop         ebp  
0040208C  ret              
You can see CUDA APIs' and explanations in the following site.

http://www.clear.rice.edu/comp422/resources/cuda/html/modules.html 
WaitForSingleObject function is usually used to wait a response of another process or thread. Most common usage is like the following code.

WaitForSingleObject(object, INFINITE);

Although it is really simple and useful, it blocks all messages until the function returned. Therefore, the application using this function acts as if it is an unresponsive applcation like applications that are hangged.

Thus, I added a message pumping feature to the WaitForSingleObject API.
The function assumes that the user uses WaitForSingleObject function with INFINITE parameter. Since it supports the message pumping feature, it allows you to wait until the object signaled with very responsive user interface.

(I know that using thread is much better than this function. However, the problem is that thread is somewhat tedious work and sometimes managing thread just for very short code is quite burden for people)

void WaitForSingleObjectWithMsgPump(HANDLE hHandle)
{
DWORD dwRet;
DWORD dwFailedCnt = 0;
while(1) {
dwRet = WaitForSingleObject(hHandle, 1);
switch( dwRet ) {
case WAIT_TIMEOUT:
// not released - let it go
dwFailedCnt = 0;
break;
case WAIT_ABANDONED:
// released
return ;
break;
case WAIT_OBJECT_0:
// released
return ;
break;
case WAIT_FAILED:
// ? 
// if failed statues are repated over 5 times, 
// consider it as released
dwFailedCnt++;
if( dwFailedCnt > 4 ) {
return ;
}
break;
}

// pump message
PumpMsg();
Sleep(1);
}
}
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( pDC ) {
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
return hbr;
http://ref.x86asm.net/
1. Analyzing and writing some stubs related to a virtualization.
2. Planning to write articles about migrating legacy software for Windows7
3. Planning a seminar or articles for Visual Studio 2010(migration issues)

Hope we will meet soon in public!
집단으로
지랄하는
성가신것들
I am going to attend Global Summit 2011!

http://icerainbow.tistory.com/1125
http://icerainbow.tistory.com/1126
This is one of the most awesome software in the world!
'Simnow' is the software what I always dreamed and wanted to get.

It emulates huge ranges of machines including up-to-date features! 


+ Recent posts