Add a Windows utility to extract next-server from IPv4 PXE reply
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10668 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
5743838edb
commit
c268671a9e
23
xCAT-server/share/xcat/netboot/windows/getnextserver.cpp
Executable file
23
xCAT-server/share/xcat/netboot/windows/getnextserver.cpp
Executable file
@ -0,0 +1,23 @@
|
||||
/* Another Windows C file. Build is much like the other, install MS SDK,
|
||||
* then run in the 'CMD shell' under SDK folder:
|
||||
* cl getnextserver.cpp advapi32.lib
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
const char* subkey = "System\\CurrentControlSet\\Control\\PXE";
|
||||
HKEY key=0;
|
||||
DWORD pxedatasize;
|
||||
LPBYTE pxedata;
|
||||
DWORD regType;
|
||||
if (RegOpenKey(HKEY_LOCAL_MACHINE,subkey,&key) == ERROR_SUCCESS) {
|
||||
// Ok, so we have found PXE, we can get next-server, woo
|
||||
RegQueryValueEx(key,"BootServerReply",0,®Type,NULL, &pxedatasize);
|
||||
pxedata=(LPBYTE)malloc(pxedatasize);
|
||||
RegQueryValueEx(key,"BootServerReply",0,®Type,pxedata, &pxedatasize);
|
||||
printf("%d.%d.%d.%d\n",pxedata[0x14],pxedata[0x15],pxedata[0x16],pxedata[0x17]);
|
||||
}
|
||||
}
|
||||
|
BIN
xCAT-server/share/xcat/netboot/windows/getnextserver.exe
Executable file
BIN
xCAT-server/share/xcat/netboot/windows/getnextserver.exe
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user