【求助】如何Hook_CreateProcess函数?

写了一个DLL,想HOOK掉目标进程对CreateProcess的调用。结果注入DLL后出错如图

代码:
//DLL Demo

//////////
#include "stdafx.h"
#include <tlhelp32.h>
#include <CAPIHook.h> //一个CAPIHOOK的类


extern CAPIHook g_CreateProcessW;

//在钩子函数中先不做任何处理,直接传递。

BOOL WINAPI Hook_CreateProcessW(LPCTSTR lpApplicationName,LPTSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes, 
  LPSECURITY_ATTRIBUTES lpThreadAttributes,BOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment, 
  LPCTSTR lpCurrentDirectory,LPSTARTUPINFO lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation)
{
  typedef    BOOL (WINAPI* PFN)(LPCTSTR,LPTSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,
              LPVOID,LPCTSTR,LPSTARTUPINFO,LPPROCESS_INFORMATION);


  BOOL bRet=((PFN)(PROC)g_CreateProcessA)(lpApplicationName,lpCommandLine, lpProcessAttributes,      lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment, 
      lpCurrentDirectory,lpStartupInfo,lpProcessInformation);

          //Other code
          //lpApplicationName的值竟然为"C",lpCommandLine值为"\""

  return bRet;
}


CAPIHook g_CreateProcess("kernel32.dll","CreateProcessW",(PROC)Hook_CreateProcessW);


//请问各位高手,错出在哪儿?

附件附件:

下载次数:712
文件类型:image/pjpeg
文件大小:
上传时间:2007-1-13 19:12:29
描述:
预览信息:EXIF信息



最后编辑2007-01-13 19:12:29.187000000