-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build fixes and a little more juggling
- Loading branch information
1 parent
340695b
commit 9a82712
Showing
4 changed files
with
28 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import COM_ABI | ||
|
||
extension COMError { | ||
/// Creates an instance of `ICreateErrorInfo`. | ||
public static func createErrorInfo() throws -> ICreateErrorInfo { | ||
var createErrorInfo = ICreateErrorInfoProjection.abiDefaultValue | ||
defer { ICreateErrorInfoProjection.release(&createErrorInfo) } | ||
try COMError.fromABI(SWRT_CreateErrorInfo(&createErrorInfo)) | ||
return try NullResult.unwrap(ICreateErrorInfoProjection.toSwift(createErrorInfo)) | ||
} | ||
|
||
/// Creates an instance of `IErrorInfo` with prepopulated fields. | ||
public static func createErrorInfo(guid: GUID? = nil, source: String? = nil, description: String?, | ||
helpFile: String? = nil, helpContext: UInt32? = nil) throws -> IErrorInfo { | ||
let errorInfo = try createErrorInfo() | ||
if let guid { try errorInfo.setGUID(guid) } | ||
if let source { try errorInfo.setSource(source) } | ||
if let description { try errorInfo.setDescription(description) } | ||
if let helpFile { try errorInfo.setHelpFile(helpFile) } | ||
if let helpContext { try errorInfo.setHelpContext(helpContext) } | ||
return try errorInfo.queryInterface(IErrorInfoProjection.self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
Support/Sources/COM/ProjectedTypes/ICreateErrorInfo+create.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters