Skip to content

Commit

Permalink
Version 14.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bribi5940 committed Jun 22, 2023
1 parent fb48e3a commit eba0fa5
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,4 @@ output/OmniMIDIWatchdog.exe
output/Test OmniMIDI Configurator.bat
output/OmniMIDIDevEnum.exe
OmniMapper/OmniMapper/OmniMIDI.h
OmniMIDIConfigurator/.vs/
Binary file modified OmniMIDI/Resource.aps
Binary file not shown.
Binary file modified OmniMIDI/Resource.rc
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,19 @@ public static void MIDIMapRegistry(Boolean Uninstall)
}
}

public static bool CheckIfDriveIsNTFS(string drive)
{
DriveInfo[] AllDrives = DriveInfo.GetDrives();

foreach (DriveInfo d in AllDrives)
{
if (d.Name == drive && d.DriveFormat == "NTFS")
return true;
}

return false;
}

public static bool CheckMIDIMapper() // Check if OmniMapper is installed
{
return (Functions.CLSID32.GetValue("midimapper", "midimap.dll").ToString() == "OmniMIDI\\OmniMapper.dll");
Expand Down Expand Up @@ -600,7 +613,25 @@ public static DialogResult ApplyWinMMWRPPatch(Boolean DAWMode, PA.FILE_ARCH Over
String.Format("{0}\\{1}", Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "OmniMIDI.dll"),
PA.SymbolicLink.File))
{
throw new Exception("No administrator permissions?");
int error = Marshal.GetLastWin32Error();

switch (error)
{
case 0x000:
break;

case 0x005:
throw new UnauthorizedAccessException("Unable to write to target file system.");

case 0x3F0:
if (!CheckIfDriveIsNTFS(Path.GetPathRoot(DirectoryPath)))
throw new NotSupportedException("Target file system not supported for symlinks.");
else
throw new UnauthorizedAccessException("Unable to write to target file system.");

default:
throw new Exception("Unknown exception.");
}
}
}

Expand All @@ -622,7 +653,25 @@ public static DialogResult ApplyWinMMWRPPatch(Boolean DAWMode, PA.FILE_ARCH Over
String.Format("{0}\\{1}", Environment.GetFolderPath(Environment.SpecialFolder.System), "OmniMIDI.dll"),
PA.SymbolicLink.File))
{
throw new Exception("No administrator permissions?");
int error = Marshal.GetLastWin32Error();

switch (error)
{
case 0x000:
break;

case 0x005:
throw new UnauthorizedAccessException("Unable to write to target file system.");

case 0x3F0:
if (!CheckIfDriveIsNTFS(Path.GetPathRoot(DirectoryPath)))
throw new NotSupportedException("Target file system not supported for symlinks.");
else
throw new UnauthorizedAccessException("Unable to write to target file system.");

default:
throw new Exception("Unknown exception.");
}
}
}

Expand All @@ -643,7 +692,25 @@ public static DialogResult ApplyWinMMWRPPatch(Boolean DAWMode, PA.FILE_ARCH Over
String.Format("{0}\\{1}", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "SysArm32"), "OmniMIDI.dll"),
PA.SymbolicLink.File))
{
throw new Exception("No administrator permissions?");
int error = Marshal.GetLastWin32Error();

switch (error)
{
case 0x000:
break;

case 0x005:
throw new UnauthorizedAccessException("Unable to write to target file system.");

case 0x3F0:
if (!CheckIfDriveIsNTFS(Path.GetPathRoot(DirectoryPath)))
throw new NotSupportedException("Target file system not supported for symlinks.");
else
throw new UnauthorizedAccessException("Unable to write to target file system.");

default:
throw new Exception("Unknown exception.");
}
}
}

Expand All @@ -659,13 +726,27 @@ public static DialogResult ApplyWinMMWRPPatch(Boolean DAWMode, PA.FILE_ARCH Over
return DialogResult.No;
}
}
catch
catch (NotSupportedException ex)
{
Program.ShowError(4, "Error", "The target file system does not support symlinks.\n\nThe patch only supports target drives formatted in NTFS.", null);
Status = "NOTSUPPR";
WinMMDialog.Dispose();
return DialogResult.No;
}
catch (UnauthorizedAccessException ex)
{
RestartAsAdmin();
Status = "ADMINREQ";
WinMMDialog.Dispose();
return DialogResult.No;
}
catch (Exception ex)
{
Program.ShowError(4, "Error", "An unknown error as occurred.", null);
Status = "UNKNOWN";
WinMMDialog.Dispose();
return DialogResult.No;
}

WinMMDialog.Dispose();
return DialogResult.OK;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ButtonToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>101, 17</value>
</metadata>
<metadata name="LisCM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand Down
1 change: 1 addition & 0 deletions external_packages/basswasapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {
#define BASS_ERROR_WASAPI_BUFFER 5001 // buffer size is invalid
#define BASS_ERROR_WASAPI_CATEGORY 5002 // can't set category
#define BASS_ERROR_WASAPI_DENIED 5003 // access denied
#define BASS_ERROR_WASAPI_RAW 5004 // raw not supported

// Device info structure
typedef struct {
Expand Down
3 changes: 3 additions & 0 deletions output/OmniMIDI.dbl
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ hamachi-2-ui.exe
hamachi-2.exe
hamachi-ui.exe
hamachi.exe
hisuite.exe
hkcmd.exe
hkeyapp.exe
hl2.exe
huaweihisuiteservice.exe
huaweihisuiteservice64.exe
hwinfo64.exe
hwinfomonitor.exe
iclouddrive.exe
Expand Down

0 comments on commit eba0fa5

Please sign in to comment.