From 084d44042ae7b2853cee29f81142333dd303a58b Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 12 Aug 2018 22:44:05 -0500 Subject: [PATCH] Prevent the CDev from running if NetDiskInit is not present. --- cdev.c | 14 +++++++++++++- cdev.rez | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cdev.c b/cdev.c index d2d5c01..8f25e7c 100644 --- a/cdev.c +++ b/cdev.c @@ -32,7 +32,8 @@ //#define optionsPopUp 6 //#define trianglePic 7 -#define mountURLError 3000 +#define netDiskMissingError 3000 +#define mountURLError 3001 extern void FreeAllCDevMem(void); @@ -91,6 +92,17 @@ void DoHit(long ctlID, CtlRecHndl ctlHandle) long DoMachine(void) { + mountURLRec.result = NETDISK_NOT_PRESENT; + mountURLRec.url = ""; + + SendRequest(MountURL, sendToName|stopAfterOne, (Long)NETDISK_REQUEST_NAME, + (Long)&mountURLRec, NULL); + + if (mountURLRec.result == NETDISK_NOT_PRESENT) { + AlertWindow(awResource+awButtonLayout, NULL, netDiskMissingError); + return 0; + } + return 1; } diff --git a/cdev.rez b/cdev.rez index 3aab98e..4d2ad73 100644 --- a/cdev.rez +++ b/cdev.rez @@ -260,7 +260,15 @@ resource rTextForLETextBox2 (helpWindow+helpTxt) { * Error messages */ -#define mountURLError 3000 +#define netDiskMissingError 3000 +#define mountURLError 3001 + +resource rAlertString (netDiskMissingError) { + "62/" + "To use this control panel, you must have NetDiskInit installed " + "in the System:System.Setup folder on the boot disk." + "/^#0\$00" +}; resource rAlertString (mountURLError) { "32:"