| | |
| | | FUNCTION_RETURN result = FUNC_RET_ERROR;
|
| | | char buffer[MAX_COMPUTERNAME_LENGTH + 1];
|
| | | int bufsize = MAX_COMPUTERNAME_LENGTH + 1;
|
| | | BOOL cmpName = GetComputerName(buffer, &bufsize);
|
| | | const BOOL cmpName = GetComputerName(buffer, &bufsize);
|
| | | if (cmpName) {
|
| | | strncpy(identifier, buffer, 6);
|
| | | result = FUNC_RET_OK;
|
| | |
| | | DWORD volSerial = 0;
|
| | | BOOL success;
|
| | | UINT driveType;
|
| | | DWORD dwSize = MAX_PATH;
|
| | | const DWORD dwSize = MAX_PATH;
|
| | | char szLogicalDrives[MAX_PATH] = { 0 };
|
| | | unsigned char buf[8] = "";
|
| | |
|
| | | FUNCTION_RETURN return_value;
|
| | | DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives);
|
| | | const DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives);
|
| | |
|
| | | if (dwResult > 0 && dwResult <= MAX_PATH) {
|
| | | return_value = FUNC_RET_OK;
|
| | |
| | | diskInfos[ndrives].id = ndrives;
|
| | | strncpy(diskInfos[ndrives].device, volName, MAX_PATH);
|
| | | strncpy(diskInfos[ndrives].label, FileSysName, MAX_PATH);
|
| | | memcpy(diskInfos[ndrives].disk_sn, &buf, sizeof(buf));
|
| | | memcpy(diskInfos[ndrives].disk_sn, &volSerial, sizeof(DWORD));
|
| | | diskInfos[ndrives].preferred = (strncmp(szSingleDrive, "C", 1) != 0);
|
| | | } else {
|
| | |
| | | FUNCTION_RETURN result;
|
| | | PIP_ADAPTER_INFO pAdapterInfo, pAdapter = NULL;
|
| | | //IP_ADAPTER_INFO AdapterInfo[20]; // Allocate information for up to 16 NICs
|
| | | DWORD dwBufLen = 0; //10 * sizeof(IP_ADAPTER_INFO); // Save the memory size of buffer
|
| | | DWORD dwBufLen = sizeof(IP_ADAPTER_INFO); //10 * sizeof(IP_ADAPTER_INFO); // Save the memory size of buffer
|
| | |
|
| | | i = 3;
|
| | | do {
|
| | |
| | | );
|
| | | if (dwStatus != NO_ERROR) {
|
| | | free(pAdapterInfo);
|
| | | pAdapterInfo = NULL;
|
| | | }
|
| | | } while (dwStatus == ERROR_BUFFER_OVERFLOW && i-- > 0);
|
| | |
|
| | |
| | | return FUNC_RET_OK;
|
| | | }
|
| | |
|
| | | memset(adapterInfos, 0, *adapter_info_size);
|
| | | *adapter_info_size = dwBufLen / sizeof(IP_ADAPTER_INFO);
|
| | | memset(adapterInfos, 0, dwBufLen);
|
| | | pAdapter = pAdapterInfo;
|
| | | i = 0;
|
| | | result = FUNC_RET_OK;
|
| | |
| | | }
|
| | | }
|
| | | free(pAdapterInfo);
|
| | | *adapter_info_size = i;
|
| | | return result;
|
| | | }
|
| | |
|
| | | FUNCTION_RETURN getModuleName(char buffer[MAX_PATH]) {
|
| | | FUNCTION_RETURN result = FUNC_RET_OK;
|
| | | DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH);
|
| | | const DWORD wres = GetModuleFileName(NULL, buffer, MAX_PATH);
|
| | | if (wres == 0) {
|
| | | result = FUNC_RET_ERROR;
|
| | | }
|
| | |
| | | free(hashStr);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * Not implemented yet.
|
| | | */
|
| | | VIRTUALIZATION getVirtualization() {
|
| | | return NONE;
|
| | | }
|
| | |
|