wok diff syslinux/stuff/iso2exe/win32.c @ rev 19870
linld: fix progname
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Mar 30 15:54:03 2017 +0200 (2017-03-30) |
parents | cc38abe27c7a |
children | 0d54617661f0 |
line diff
1.1 --- a/syslinux/stuff/iso2exe/win32.c Sat Feb 04 10:53:16 2017 +0100 1.2 +++ b/syslinux/stuff/iso2exe/win32.c Thu Mar 30 15:54:03 2017 +0200 1.3 @@ -4,6 +4,7 @@ 1.4 #include <sys/stat.h> 1.5 #include <fcntl.h> 1.6 1.7 +#define VCPI_LINUX_LOADER The DOS/EXE loader can boot in VM86 using VCPI API 1.8 #define BOOTSTRAP_SECTOR_COUNT_OFFSET 26 1.9 1.10 static int fullread(int fd, char *p, int n) 1.11 @@ -28,6 +29,7 @@ 1.12 #define write fullwrite 1.13 } 1.14 1.15 +#ifdef VCPI_LINUX_LOADER 1.16 static void exec16bits(char *isoFileName) 1.17 { 1.18 int fdiso, fdtmp, i; 1.19 @@ -49,6 +51,7 @@ 1.20 close(fdtmp); 1.21 execl(tmpFileName, isoFileName); 1.22 } 1.23 +#endif 1.24 1.25 static int iswinnt(void) 1.26 { 1.27 @@ -58,6 +61,7 @@ 1.28 Version.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS); // not Win9x 1.29 } 1.30 1.31 +#define LONG(x) * (unsigned long *) (x) 1.32 static int ishybrid(char *isoFileName) 1.33 { 1.34 int fdiso; 1.35 @@ -68,16 +72,15 @@ 1.36 if (lseek(fdiso, 17 * 2048L, SEEK_SET) != -1 && 1.37 read(fdiso, buffer, 2048) == 2048 && 1.38 strncmp(buffer+7,"EL TORITO SPECIFICATION",23) == 0) { 1.39 - unsigned long lba = * (unsigned long *) (buffer + 71); 1.40 + unsigned long lba = LONG(buffer + 71); 1.41 1.42 if (lseek(fdiso, lba * 2048L, SEEK_SET) != -1 && 1.43 read(fdiso, buffer, 2048) == 2048 && 1.44 - * (unsigned long *) (buffer + 0) == 1 && 1.45 - * (unsigned long *) (buffer + 30) == 0x88AA55) { 1.46 - lba = * (unsigned long *) (buffer + 40); 1.47 + LONG(buffer + 0) == 1 && LONG(buffer + 30) == 0x88AA55) { 1.48 + lba = LONG(buffer + 40); 1.49 if (lseek(fdiso, lba * 2048L, SEEK_SET) != -1 && 1.50 read(fdiso, buffer, 2048) == 2048) 1.51 - magic = * (unsigned long *) (buffer + 64); 1.52 + magic = LONG(buffer + 64); 1.53 } 1.54 } 1.55 close(fdiso); 1.56 @@ -169,7 +172,6 @@ 1.57 } 1.58 } 1.59 1.60 -#define VCPI_LINUX_LOADER The DOS/EXE loader can boot in VM86 using VCPI API 1.61 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 1.62 LPSTR lpCmdLine, int nCmdShow) 1.63 { 1.64 @@ -213,7 +215,14 @@ 1.65 } 1.66 if (header[BOOTSTRAP_SECTOR_COUNT_OFFSET] == 0) { // No floppy bootstrap available 1.67 usbkeyicon = MB_ICONQUESTION; 1.68 - usbkeymsg = "Do you want to create a boot key ?"; 1.69 + usbkeymsg = 1.70 + "You can create a SliTaz USB boot key or\n" 1.71 + "a boot memory card.\n" 1.72 + "(note that this will be read only like\n" 1.73 + "a CDROM. The Slitaz utility 'tazusb'\n" 1.74 + "can be used later to create a true\n" 1.75 + "read/write USB key).\n" 1.76 + "\nDo you want to create a boot key now ?"; 1.77 } 1.78 if (MessageBox(NULL,usbkeymsg, "Create a boot stick ?", 1.79 MB_YESNO|usbkeyicon) == IDYES) {