Bonjours quelqun pourrai me traduire se script C++ en VB6??
* #include <windows.h>
*
* BOOL SetDebugPrivileges(VOID) {
* /*
* *
* *
* */
* DWORD dwPID;
* HANDLE hProcess;
* HANDLE hToken;
* LUID Luid;
* TOKEN_PRIVILEGES tpDebug;
* dwPID = GetCurrentProcessId();
* if ((hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID)) == NULL) return FALSE;
* if (OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken) == 0) return FALSE;
* if ((LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &Luid)) == 0) return FALSE;
* tpDebug.PrivilegeCount = 1;
* tpDebug.Privileges[0].Luid = Luid;
* tpDebug.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
* if ((AdjustTokenPrivileges(hToken, FALSE, &tpDebug, sizeof(tpDebug), NULL, NULL)) == 0) return FALSE;
* if (GetLastError() != ERROR_SUCCESS) return FALSE;
* CloseHandle(hToken);
* CloseHandle(hProcess);
* return TRUE;
* }
*
* #include <stdio.h>
*
* int main(int argc, char** argv) {
* /*
* *
* *
* *
* */
* int i = 0;
* if (argc < 2) {
* puts("Usage: kill <PID 1> [<PID 2> ... <PID n>]");
* return 0;
* }
* if (SetDebugPrivileges() == 0) puts("Unable to grant debug privileges !");
* while (++i < argc) {
* DWORD dwPID;
* HANDLE hProcess;
* dwPID = atoi(argv[i]);
* if ((hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwPID)) != NULL) {
* if (TerminateProcess(hProcess, 0) == 0) printf("Unable to kill process %lu !\n", dwPID);
* CloseHandle(hProcess);
* } else printf("Unable to access process %lu !\n", dwPID);
* }
* return 0;
* }
Merci