Rev 186 | Rev 188 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 186 | Rev 187 | ||
---|---|---|---|
Line 878... | Line 878... | ||
878 | wchar_t descriptionfile_pathname[MAX_PATH]; |
878 | wchar_t descriptionfile_pathname[MAX_PATH]; |
879 | char temp_string[1024]; |
879 | char temp_string[1024]; |
880 | struct sockaddr_in service; |
880 | struct sockaddr_in service; |
881 | struct hostent *hostinfo; |
881 | struct hostent *hostinfo; |
882 | SHELLEXECUTEINFO bugreport_shinfo; |
882 | SHELLEXECUTEINFO bugreport_shinfo; |
- | 883 | MEMORYSTATUSEX memory_status; |
|
883 | buffer_t temp_buffer; |
884 | buffer_t temp_buffer; |
884 | buffer_t description_buffer; |
885 | buffer_t description_buffer; |
885 | buffer_t logfile_buffer; |
886 | buffer_t logfile_buffer; |
886 | buffer_t board_buffer; |
887 | buffer_t board_buffer; |
887 | buffer_t http_buffer; // used for both request and reply |
888 | buffer_t http_buffer; // used for both request and reply |
- | 889 | size_t dummy_size; |
|
888 | bool was_successful; |
890 | bool was_successful; |
889 | unsigned char color; |
891 | unsigned char color; |
890 | unsigned char part; |
892 | unsigned char part; |
- | 893 | wchar_t *osversion; |
|
891 | char *base64buffer; // mallocated |
894 | char *base64buffer; // mallocated |
892 | int write_index; |
895 | int write_index; |
893 | int read_index; |
896 | int read_index; |
894 | int length; |
897 | int length; |
895 | SOCKET s; |
898 | SOCKET s; |
Line 1004... | Line 1007... | ||
1004 | Buffer_AppendCharArray (&http_buffer, "&player1="); Buffer_Append (&http_buffer, (the_board.players[COLOR_WHITE].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_WHITE].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1007 | Buffer_AppendCharArray (&http_buffer, "&player1="); Buffer_Append (&http_buffer, (the_board.players[COLOR_WHITE].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_WHITE].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1005 | Buffer_AppendCharArray (&http_buffer, "&player2="); Buffer_Append (&http_buffer, (the_board.players[COLOR_BLACK].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_BLACK].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1008 | Buffer_AppendCharArray (&http_buffer, "&player2="); Buffer_Append (&http_buffer, (the_board.players[COLOR_BLACK].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_BLACK].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1006 | Buffer_AppendCharArray (&http_buffer, "&board="); base64_encode (base64buffer, board_buffer.data, board_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1009 | Buffer_AppendCharArray (&http_buffer, "&board="); base64_encode (base64buffer, board_buffer.data, board_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1007 | Buffer_AppendCharArray (&http_buffer, "&log="); base64_encode (base64buffer, logfile_buffer.data, logfile_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1010 | Buffer_AppendCharArray (&http_buffer, "&log="); base64_encode (base64buffer, logfile_buffer.data, logfile_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1008 | Buffer_AppendCharArray (&http_buffer, "&description="); base64_encode (base64buffer, description_buffer.data, description_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1011 | Buffer_AppendCharArray (&http_buffer, "&description="); base64_encode (base64buffer, description_buffer.data, description_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
- | 1012 | Buffer_AppendCharArray (&http_buffer, "&os="); GetSystemDirectoryA (temp_string, sizeof (temp_string)); strcat_s (temp_string, sizeof (temp_string), "\\cmd.exe"); Buffer_ReadFromFile (&temp_buffer, temp_string); osversion = L""; for (i = 0; i < (int) temp_buffer.size - 30; i++) if (wcscmp ((wchar_t *) &temp_buffer.data[i], L"ProductVersion") == 0) { osversion = (wchar_t *) &temp_buffer.data[i + 30]; break; } ConvertTo7BitASCII (temp_string, sizeof (temp_string), osversion); Buffer_Forget (&temp_buffer); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
|
- | 1013 | Buffer_AppendCharArray (&http_buffer, "&cpu="); temp_string[0] = 0; getenv_s (&dummy_size, temp_string, sizeof (temp_string), "PROCESSOR_IDENTIFIER"); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
|
- | 1014 | Buffer_AppendCharArray (&http_buffer, "&ram="); memory_status.dwLength = sizeof (memory_status); GlobalMemoryStatusEx (&memory_status); sprintf_s (temp_string, sizeof (temp_string), "Memory usage: %d%%\nPhysical total %d Mb (free %d Mb)\nPaging total %d Mb (free %d Mb)\nVirtual total %d Mb (free %d Mb)", (int) memory_status.dwMemoryLoad, (int) (memory_status.ullTotalPhys / (1024 * 1024)), (int) (memory_status.ullAvailPhys / (1024 * 1024)), (int) (memory_status.ullTotalPageFile / (1024 * 1024)), (int) (memory_status.ullAvailPageFile / (1024 * 1024)), (int) (memory_status.ullTotalVirtual / (1024 * 1024)), (int) (memory_status.ullAvailVirtual / (1024 * 1024))); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
|
1009 | Buffer_Forget (&description_buffer); |
1015 | Buffer_Forget (&description_buffer); |
1010 | Buffer_Forget (&logfile_buffer); |
1016 | Buffer_Forget (&logfile_buffer); |
1011 | Buffer_Forget (&board_buffer); |
1017 | Buffer_Forget (&board_buffer); |
1012 | free (base64buffer); |
1018 | free (base64buffer); |
1013 | length = http_buffer.size; |
1019 | length = http_buffer.size; |