ffi/unsafe/com: use ffi/file instead of C API

This commit is contained in:
Matthew Flatt 2019-05-01 14:41:17 -06:00
parent 92c12de018
commit 651fc3ae5e

View File

@ -4,6 +4,7 @@
ffi/winapi ffi/winapi
ffi/unsafe/atomic ffi/unsafe/atomic
ffi/unsafe/custodian ffi/unsafe/custodian
ffi/file
racket/date racket/date
racket/runtime-path racket/runtime-path
racket/list racket/list
@ -555,9 +556,6 @@
(struct com-type (type-info clsid)) (struct com-type (type-info clsid))
(define scheme_security_check_file
(get-ffi-obj 'scheme_security_check_file #f (_fun _string _path _int -> _void)))
(define SCHEME_GUARD_FILE_EXECUTE #x4) (define SCHEME_GUARD_FILE_EXECUTE #x4)
(define (register-with-custodian obj) (define (register-with-custodian obj)
@ -582,11 +580,11 @@
;; check. Putting it in the Windows system folder suggests ;; check. Putting it in the Windows system folder suggests
;; an appropriate level of trust: outside of the Racket installation, ;; an appropriate level of trust: outside of the Racket installation,
;; but installed on the current machine. ;; but installed on the current machine.
(scheme_security_check_file "com-create-instance" (security-guard-check-file 'com-create-instance
(build-path (find-system-path 'sys-dir) (build-path (find-system-path 'sys-dir)
"com" "com"
(guid->string clsid)) (guid->string clsid))
SCHEME_GUARD_FILE_EXECUTE) '(execute))
(define machine (define machine
(cond (cond