File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ pub const ERROR_BUFFER_OVERFLOW: u64 = 0x6f;
4343pub const ERROR_INVALID_PARAMETER : u64 = 0x57 ;
4444pub const ERROR_INSUFFICIENT_BUFFER : u64 = 0x7a ;
4545
46+
47+ pub const HRESULT_E_INVALID_ARG : u64 = 0x80070057 ;
48+ /*
49+ * HRESULT STRUCTURE:
50+ * 0x8 -> severity: error
51+ * 0x007 -> facility: FACILITY_WIN32
52+ * 0x0057 -> ERROR_INVALID_PARAMETER
53+ */
54+
4655pub const CP_UTF7 : u64 = 65000 ;
4756pub const CP_UTF8 : u64 = 65001 ;
4857
Original file line number Diff line number Diff line change @@ -986,10 +986,8 @@ fn NtReadFile(emu: &mut emu::Emu) {
986986
987987 emu. maps . memset ( buff, 0x90 , len) ;
988988
989- // TODO: fix path duplication!!!!
990- if filename == "\\ ??\\ c:\\ cwd\\ c:\\ cwd\\ version.dll" {
991- let local_path = "/tmp/version2.dll" ;
992- let mut file = File :: open ( local_path) . unwrap ( ) ;
989+ if filename == "\\ ??\\ c:\\ cwd" {
990+ let mut file = File :: open ( & emu. filename ) . unwrap ( ) ;
993991 file. seek ( SeekFrom :: Start ( file_offset) ) ;
994992 let mut file_buffer = vec ! [ 0u8 ; len] ;
995993 let bytes_read = file. read ( & mut file_buffer) . unwrap ( ) ;
@@ -1013,6 +1011,8 @@ fn NtReadFile(emu: &mut emu::Emu) {
10131011 panic ! ( "TODO: read {}" , filename) ;
10141012 }
10151013
1014+
1015+
10161016 emu. regs_mut ( ) . rax = constants:: STATUS_SUCCESS ;
10171017}
10181018
Original file line number Diff line number Diff line change @@ -298,7 +298,7 @@ fn VariantClear(emu: &mut emu::Emu) {
298298 // Basic validation
299299 if pvarg == 0 || !emu. maps . is_mapped ( pvarg) {
300300 log_red ! ( emu, "VariantClear: Invalid pvarg pointer" ) ;
301- emu. regs_mut ( ) . rax = 0x80070057 ; // E_INVALIDARG
301+ emu. regs_mut ( ) . rax = constants :: HRESULT_E_INVALID_ARG ;
302302 return ;
303303 }
304304
You can’t perform that action at this time.
0 commit comments