HINSTANCE hDllInst = LoadLibrary("KERNEL32.DLL"); 
    if(hDllInst) 
{         
typedef DWORD (WINAPI *MYFUNC)(DWORD,DWORD); 

MYFUNC RegisterServiceProcessAlias = NULL; 

RegisterServiceProcessAlias = (MYFUNC)GetProcAddress(hDllInst, "RegisterServiceProcess"); 

if(RegisterServiceProcessAlias) //总是为NULL,所以程序不向下进行
{     
RegisterServiceProcessAlias(GetCurrentProcessId(),0); 

FreeLibrary(hDllInst); 
}