LONG WINAPI Mine_RegDeleteValueA(HKEY a0, LPCSTR a1) { if (CFilterMapper2::m_pFilterMapper2 && (a0 == FAKEHKEY || (INT_PTR)a0 < 0)) { return ERROR_SUCCESS; } return Real_RegDeleteValueA(a0, a1); }
// RegDeleteKeyA替换 LONG WINAPI Replace_RegDeleteValueA(HKEY hKey,LPCSTR lpValueName) { LONG nRet; __try { nRet = Real_RegDeleteValueA(hKey, lpValueName); if(!HOOK_RegDeleteValue) return nRet; if(GetCurrentProcessId() == ExplorerPID) return nRet; if(GetCurrentProcessId() == RegMonPID) return nRet; if((PID == 0) || ((GetCurrentProcessId() == PID) && (PID>0)) ) { if(lpValueName == NULL) return nRet; COPYDATASTRUCT data; PARAMS params; memset(¶ms,0,sizeof(PARAMS)); params.PID = GetCurrentProcessId(); params.hKey = hKey; memcpy(params.buf1, lpValueName, strlen(lpValueName)); data.cbData = sizeof(PARAMS); data.lpData = (void *)¶ms; data.dwData = TYPE_RegDeleteValueA; SendMessage(g_hWnd, WM_COPYDATA, (WPARAM)g_hWnd, (LPARAM)&data); } }__finally { }; return nRet; }
LONG WINAPI Mine_RegDeleteValueA(HKEY a0, LPCSTR a1) { // (INT_PTR)a0 < 0 will catch all attempts to use a predefined HKEY directly if (CFilterMapper2::s_pFilterMapper2 && (a0 == FAKEHKEY || (INT_PTR)a0 < 0)) { return ERROR_SUCCESS; } return Real_RegDeleteValueA(a0, a1); }