fork download
  1. #include <winsock2.h>
  2. #include <windows.h>
  3. #include <shellapi.h>
  4.  
  5. int main()
  6. {
  7. /*
  8. Creation and initialization socket
  9. */
  10.  
  11. const wchar_t* name;
  12. wchar_t path[300];
  13. wchar_t res[300];
  14.  
  15. recv(sock, name, 14, 0);
  16.  
  17. GetModuleFileNameW(NULL, path, 300);
  18.  
  19. wcsncat(res, name, wcslen(name));
  20. wcsncat(res, L" ", 1);
  21. wcsncat(res, path, wcslen(path));
  22.  
  23. STARTUPINFO si;
  24. PROCESS_INFORMATION pi;
  25. memset(&si, 0, sizeof(si));
  26.  
  27. if(!CreateProcessW(NULL,res,NULL,NULL,FALSE,0,NULL, NULL,&si,&pi))
  28. {
  29. printf("Error code:%i", GetLastError());
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:22: fatal error: winsock2.h: No such file or directory
 #include <winsock2.h>
                      ^
compilation terminated.
stdout
Standard output is empty