Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ipxe Computer hostname Same ?
2012-01-28, 17:59
Post: #1
Question ipxe Computer hostname Same ?
Hello, everyone!

ipxe, multi Computer boot windos xp, Computer hostname Same problem?

Where can automatically set windows xp hostname?

Thanks
Find all posts by this user
Quote this message in a reply
2012-01-29, 13:00
Post: #2
RE: ipxe Computer hostname Same ?
+ * Store hostname parameters in registry
+ *
+ * @v hostname ComputerName
+ * @ret ntstatus NT status
+ */
+static NTSTATUS store_hostname_parameters(LPSTR hostname) {
+ LPWSTR value_name;
+ HANDLE reg_key;
+ NTSTATUS status;
+ WCHAR buf[256];
+ LPCWSTR star = L"star";
+ WCHAR key_name_computername[] = ( L"\\Registry\\Machine\\SYSTEM\\"
+ L"CurrentControlSet\\Control\\ComputerName\\ComputerName\\");
+
+ WCHAR key_name_hostname[] = ( L"\\Registry\\Machine\\SYSTEM\\"
+ L"CurrentControlSet\\Services\\"
+ L"Tcpip\\Parameters\\" );
+
+ RtlStringCbPrintfW ( buf, sizeof ( buf ),
+ L"%wS-%S", star, hostname );
+ value_name = buf;
+ /* Open key */
+ status = reg_open ( key_name_computername, &reg_key );
+ if ( ! NT_SUCCESS ( status ) )
+ goto err_reg_open;
+
+ /* Store computername */
+ status = reg_store_sz ( reg_key, L"ComputerName", value_name );
+ if ( ! NT_SUCCESS ( status ) )
+ goto err_reg_store;
+
+ /* Close key */
+ reg_close(reg_key);
+
+ /* open key */
+ status = reg_open(key_name_hostname, &reg_key);
+ if (!NT_SUCCESS(status))
+ goto err_reg_open;
+
+ /* Store hostname */
+ status = reg_store_sz ( reg_key, L"Hostname", value_name );
+ if ( ! NT_SUCCESS ( status ) )
+ goto err_reg_store;
+ status = reg_store_sz ( reg_key, L"NV Hostname", value_name );
+ if ( ! NT_SUCCESS ( status ) )
+ goto err_reg_store;
+ /* Store hostname end */
+ err_reg_store:
+ reg_close ( reg_key );
+ err_reg_open:
+ return status;
+}
+
+/**
* Store TCP/IP parameters in registry
*
* @v nic iBFT NIC structure
@@ -904,6 +957,11 @@
UNICODE_STRING u_symlink;
NTSTATUS status;

+ /* get computername */
+ status = store_hostname_parameters(ibft_string(ibft, &nic->hostname));
+ if(!NT_SUCCESS(status))
+ DbgPrint("Set ComputerName Fail!\n");
+
/* Dump structure information */
DbgPrint ( "Found iBFT NIC %d:\n", header->index );
DbgPrint ( " Flags = %#02x%s%s\n", header->flags,
Find all posts by this user
Quote this message in a reply
2016-07-30, 22:10
Post: #3
RE: ipxe Computer hostname Same ?
What's this supposed to be a patch against?
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-07-31, 15:50 (This post was last modified: 2016-07-31 15:54 by MultimediaMan.)
Post: #4
RE: ipxe Computer hostname Same ?
It's not a patch; I think it's a script/ or code to sync the hostname of the #running# client (in Windows XP/2003) to that of the hostname provided by the DHCP Server and/or iPXE (iBFT).

Observations: This probably wouldn't work on a Domain-joined client.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)