File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ pub mod memory_map;
6868pub mod reader;
6969pub mod writer;
7070
71+ use crate :: workflow:: Workflow ;
7172pub use memory_map:: MemoryMap ;
7273pub use reader:: BinaryReader ;
7374pub use writer:: BinaryWriter ;
@@ -324,6 +325,14 @@ pub trait BinaryViewExt: BinaryViewBase {
324325 unsafe { BNAbortAnalysis ( self . as_ref ( ) . handle ) }
325326 }
326327
328+ fn workflow ( & self ) -> Ref < Workflow > {
329+ unsafe {
330+ let raw_ptr = BNGetWorkflowForBinaryView ( self . as_ref ( ) . handle ) ;
331+ let nonnull = NonNull :: new ( raw_ptr) . expect ( "All views must have a workflow" ) ;
332+ Workflow :: ref_from_raw ( nonnull)
333+ }
334+ }
335+
327336 fn analysis_info ( & self ) -> Result < AnalysisInfo > {
328337 let info_ref = unsafe { BNGetAnalysisInfo ( self . as_ref ( ) . handle ) } ;
329338 if info_ref. is_null ( ) {
You can’t perform that action at this time.
0 commit comments