*  Written by James Harper, October 2008
  */
 
-//#include <windows.h>
-
 extern "C" {
 
 #define BACKUP_NODE_TYPE_MACHINE                0x001
 extern HrESERestoreSaveEnvironment_t HrESERestoreSaveEnvironment;
 extern HrESERestoreAddDatabase_t HrESERestoreAddDatabase;
 extern HrESERestoreOpenFile_t HrESERestoreOpenFile;
+
+typedef enum _COMPUTER_NAME_FORMAT {
+   ComputerNameNetBIOS,
+   ComputerNameDnsHostname,
+   ComputerNameDnsDomain,
+   ComputerNameDnsFullyQualified,
+   ComputerNamePhysicalNetBIOS,
+   ComputerNamePhysicalDnsHostname,
+   ComputerNamePhysicalDnsDomain,
+   ComputerNamePhysicalDnsFullyQualified,
+   ComputerNameMax
+} COMPUTER_NAME_FORMAT;
+
+BOOL WINAPI GetComputerNameExW(
+   COMPUTER_NAME_FORMAT NameType,
+   LPWSTR lpBuffer,
+   LPDWORD lpnSize
+);
+
 }
 
    bfuncs->registerBaculaEvents(ctx, 1, 2, 0);
    size = MAX_COMPUTERNAME_LENGTH + 1;
    context->computer_name = new WCHAR[size];
+   /*
    GetComputerNameW(context->computer_name, &size);
+   */
+   GetComputerNameExW(ComputerNameNetBIOS, context->computer_name, &size);
    context->current_node = NULL;
    context->root_node = NULL;
    return retval;