- 1>configure.cpp
- 1>.\configure.cpp(154) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
- 1>.\configure.cpp(154) : error C2146: syntax error : missing ')' before identifier 'ComputerNameDnsFullyQualified'
- 1>.\configure.cpp(154) : error C3861: 'GetComputerNameEx': identifier not found
- 1>.\configure.cpp(154) : error C2059: syntax error : ')'
- void get_machine_info(char * buffer, size_t len)
- {
- char buf[500];
- char buf2[500];
- DWORD dwSize = sizeof(buf);
- if (!GetComputerNameEx((COMPUTER_NAME_FORMAT)ComputerNameDnsFullyQualified, buf, &dwSize))
- sprintf(buf, "%s", "unknown");
- FILE * f = fopen("ver.txt.tmp", "r");
- if (f)
- {
- while (fgets(buf2, 500, f)) { }
- fclose(f);
- unlink("ver.txt.tmp");
- }
- else
- sprintf(buf2, "%s", "unknown");
- sprintf(buffer, "%s ", buf);
- //strip newlines
- char* b = buffer + strlen(buf)+1;
- char *b2 = buf2;
- while (*b2)
- {
- if (*b2 != 10 && *b2 != 13)
- {
- *b = *b2;
- b++;
- }
- *b2++;
- }
- *b = 0;
- }
ffffffffffff
Posted by z0TK on Wed 15th Sep 2010 15:29
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
kpaste.net RSS