winefile: format disk

Martin Fuchs martin-fuchs at gmx.net
Sun May 15 06:28:00 CDT 2005


This patch depends on the last patch "SHFormatDrive flags".


Changelog:
Implement menu entry "format disk"  (derived from Robert Dickenson's code <robd at reactos.org>)


Index: resource.h
===================================================================
RCS file: /home/wine/wine/programs/winefile/resource.h,v
retrieving revision 1.9
diff -u -p -d -r1.9 resource.h
--- resource.h	14 May 2005 18:50:30 -0000	1.9
+++ resource.h	15 May 2005 11:26:40 -0000
@@ -41,6 +41,7 @@
 #define	ID_EXECUTE					105
 #define ID_FILE_MOVE					106
 #define	ID_FILE_EXIT					115
+#define	ID_FORMAT_DISK					203
 #define	ID_VIEW_NAME					401
 #define	ID_VIEW_ALL_ATTRIBUTES				402
 #define	ID_VIEW_SELECTED_ATTRIBUTES			403
Index: Cs.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Cs.rc,v
retrieving revision 1.2
diff -u -p -d -r1.2 Cs.rc
--- Cs.rc	13 May 2005 17:45:31 -0000	1.2
+++ Cs.rc	15 May 2005 11:23:34 -0000
@@ -59,7 +59,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Kopírovat disk..." ,			201
 		MENUITEM "&Pojmenovat disk..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formátovat disk..." ,			203
+		MENUITEM "&Formátovat disk..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "Vytvoøit systé&mový disk...", -1	/*@@ */
 #endif
Index: De.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/De.rc,v
retrieving revision 1.7
diff -u -p -d -r1.7 De.rc
--- De.rc	14 May 2005 11:07:39 -0000	1.7
+++ De.rc	15 May 2005 11:23:35 -0000
@@ -58,7 +58,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "Datenträger &kopieren..." ,			201
 		MENUITEM "Datenträger &benennen..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "Datenträger &formatieren..." ,			203
+		MENUITEM "Datenträger &formatieren..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "...",			-1	/*@@ */
 #endif
Index: En.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/En.rc,v
retrieving revision 1.12
diff -u -p -d -r1.12 En.rc
--- En.rc	14 May 2005 11:07:39 -0000	1.12
+++ En.rc	15 May 2005 11:23:35 -0000
@@ -58,7 +58,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copy Disk..." ,			201
 		MENUITEM "&Label Disk..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Format Disk..." ,			203
+		MENUITEM "&Format Disk..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Make System Disk...", -1	/*TODO*/
 #endif
Index: Es.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Es.rc,v
retrieving revision 1.5
diff -u -p -d -r1.5 Es.rc
--- Es.rc	13 May 2005 17:45:31 -0000	1.5
+++ Es.rc	15 May 2005 11:23:35 -0000
@@ -56,7 +56,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copiar disco..." ,			201
 		MENUITEM "E&tiquetar disco..." ,		202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatear disco..." ,		203
+		MENUITEM "&Formatear disco..." ,		ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Hacer disco de sistema...",		-1	/*TODO*/
 #endif
Index: Fr.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Fr.rc,v
retrieving revision 1.5
diff -u -p -d -r1.5 Fr.rc
--- Fr.rc	13 May 2005 17:45:31 -0000	1.5
+++ Fr.rc	15 May 2005 11:23:35 -0000
@@ -59,7 +59,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copier Disque..." ,			201
 		MENUITEM "&Nommer Disque..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formater Disque..." ,			203
+		MENUITEM "&Formater Disque..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "Créer un disque *système...", -1	/*@@ */
 #endif
Index: Hu.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Hu.rc,v
retrieving revision 1.3
diff -u -p -d -r1.3 Hu.rc
--- Hu.rc	13 May 2005 17:45:31 -0000	1.3
+++ Hu.rc	15 May 2005 11:23:35 -0000
@@ -59,7 +59,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "Lemez &másolása..." ,			201
 		MENUITEM "&Lemezcimke..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatálás..." ,			203
+		MENUITEM "&Formatálás..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Rendszerlemez készítése...", -1	/*@@ */
 #endif
Index: It.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/It.rc,v
retrieving revision 1.6
diff -u -p -d -r1.6 It.rc
--- It.rc	13 May 2005 17:45:31 -0000	1.6
+++ It.rc	15 May 2005 11:23:35 -0000
@@ -59,7 +59,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copia Disco..." ,			201
 		MENUITEM "&Etichetta Disco..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatta Disco..." ,			203
+		MENUITEM "&Formatta Disco..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Crea Disco di Sistema...", -1	/*@@ */
 #endif
Index: Nl.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Nl.rc,v
retrieving revision 1.3
diff -u -p -d -r1.3 Nl.rc
--- Nl.rc	13 May 2005 17:45:31 -0000	1.3
+++ Nl.rc	15 May 2005 11:23:35 -0000
@@ -55,7 +55,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "Disk &kopiëren..." ,          201
 		MENUITEM "Disklabel maken..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "Disk &formatteren..." ,       203
+		MENUITEM "Disk &formatteren..." ,       ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "Systeemdisk maken...", -1	/*@@ */
 #endif
Index: Pl.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Pl.rc,v
retrieving revision 1.5
diff -u -p -d -r1.5 Pl.rc
--- Pl.rc	13 May 2005 17:45:31 -0000	1.5
+++ Pl.rc	15 May 2005 11:23:35 -0000
@@ -59,7 +59,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Kopiuj dusk..." ,			201
 		MENUITEM "&Etykieta dysku..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatuj dysk..." ,			203
+		MENUITEM "&Formatuj dysk..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Stwórz dysk systemowy...", -1	/*@@ */
 #endif
Index: Pt.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Pt.rc,v
retrieving revision 1.5
diff -u -p -d -r1.5 Pt.rc
--- Pt.rc	13 May 2005 17:45:31 -0000	1.5
+++ Pt.rc	15 May 2005 11:23:35 -0000
@@ -58,7 +58,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copiar disco..." ,			201
 		MENUITEM "&Nomear disco..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatar disco..." ,			203
+		MENUITEM "&Formatar disco..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Gerar disco de sistema...", -1	/*@@ */
 #endif
@@ -185,7 +185,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copiar disco..." ,			201
 		MENUITEM "&Nomear disco..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Formatar disco..." ,			203
+		MENUITEM "&Formatar disco..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Gerar disco de sistema...", -1	/*@@ */
 #endif
Index: Ru.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Ru.rc,v
retrieving revision 1.3
diff -u -p -d -r1.3 Ru.rc
--- Ru.rc	13 May 2005 17:45:31 -0000	1.3
+++ Ru.rc	15 May 2005 11:23:35 -0000
@@ -55,7 +55,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Êîïèðîâàòü äèñê..." ,			201
 		MENUITEM "&Ìåòêà òîìà..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Ôîðìàòèðîâàòü..." ,			203
+		MENUITEM "&Ôîðìàòèðîâàòü..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Ñîçäàòü ñèñòåìíûé äèñê...", -1	/*@@ */
 #endif
Index: Si.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Si.rc,v
retrieving revision 1.3
diff -u -p -d -r1.3 Si.rc
--- Si.rc	13 May 2005 17:45:31 -0000	1.3
+++ Si.rc	15 May 2005 11:23:35 -0000
@@ -56,7 +56,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "&Copy Disk..." ,			201
 		MENUITEM "&Label Disk..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "&Format Disk..." ,			203
+		MENUITEM "&Format Disk..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "&Make System Disk...", -1	/*@@ */
 #endif
Index: Zh.rc
===================================================================
RCS file: /home/wine/wine/programs/winefile/Zh.rc,v
retrieving revision 1.3
diff -u -p -d -r1.3 Zh.rc
--- Zh.rc	13 May 2005 17:45:31 -0000	1.3
+++ Zh.rc	15 May 2005 11:23:35 -0000
@@ -56,7 +56,7 @@ IDM_WINEFILE MENU FIXED IMPURE
 		MENUITEM "¸´ÖÆ£¨&C£©..." ,			201
 		MENUITEM "ÃüÃû£¨&L£©..." ,			202
 		MENUITEM SEPARATOR
-		MENUITEM "¸ñʽ»¯£¨&£©..." ,			203
+		MENUITEM "¸ñʽ»¯£¨&£©..." ,			ID_FORMAT_DISK
 #ifdef _WIN95
 		MENUITEM "½¨Á¢ÏµÍ³ÅÌ£¨&M£©...", -1	/*@@ */
 #endif
Index: winefile.c
===================================================================
RCS file: /home/wine/wine/programs/winefile/winefile.c,v
retrieving revision 1.37
diff -u -p -d -r1.37 winefile.c
--- winefile.c	14 May 2005 18:50:30 -0000	1.37
+++ winefile.c	15 May 2005 11:23:37 -0000
@@ -1952,6 +1970,13 @@ LRESULT CALLBACK FrameWndProc(HWND hwnd,
 					}
 					break;}
 
+				case ID_FORMAT_DISK: {
+					UINT sem_org = SetErrorMode(0); /* Get the current Error Mode settings. */
+					SetErrorMode(sem_org & ~SEM_FAILCRITICALERRORS); /* Force O/S to handle */
+					SHFormatDrive(hwnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
+					SetErrorMode(sem_org); /* Put it back the way it was. */
+					break;}
+
 				case ID_HELP:
 					WinHelp(hwnd, RS(b1,IDS_WINEFILE), HELP_INDEX, 0);
 					break;





More information about the wine-patches mailing list