Skip to content

Commit

Permalink
Merge pull request #137 from mpoindexter/fix-invalid-handle-main
Browse files Browse the repository at this point in the history
Fix for arm
  • Loading branch information
Code-Hex authored Sep 3, 2023
2 parents cf2fc7a + a554b7d commit 3c9c884
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion virtualization_12_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr

void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *restoreImageFilePath);
void *newProgressObserverVZMacOSInstaller();
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler);
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, uintptr_t completionHandler, uintptr_t fractionCompletedHandler);
void cancelInstallVZMacOSInstaller(void *installerPtr);

#endif
6 changes: 3 additions & 3 deletions virtualization_12_arm64.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
{
if ([keyPath isEqualToString:@"fractionCompleted"] && [object isKindOfClass:[NSProgress class]]) {
NSProgress *progress = (NSProgress *)object;
macOSInstallFractionCompletedHandler(context, progress.fractionCompleted);
macOSInstallFractionCompletedHandler((uintptr_t)context, progress.fractionCompleted);
if (progress.finished) {
[progress removeObserver:self forKeyPath:@"fractionCompleted"];
}
Expand Down Expand Up @@ -423,7 +423,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr
return [[ProgressObserver alloc] init];
}

void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler)
void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, uintptr_t completionHandler, uintptr_t fractionCompletedHandler)
{
if (@available(macOS 12, *)) {
VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr;
Expand All @@ -435,7 +435,7 @@ void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progress
addObserver:(ProgressObserver *)progressObserverPtr
forKeyPath:@"fractionCompleted"
options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew
context:fractionCompletedHandler];
context:(void*)fractionCompletedHandler];
});
return;
}
Expand Down

0 comments on commit 3c9c884

Please sign in to comment.