Prev Previous Post   Next Post Next
Old 21st May 2014, 19:11   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Does it work on XP but not on 7? Or does it work on neither?

This is the my code (ReadFile fails with 87 - invalid parameter).
code:
Section Main
StrCpy $3 "\\.\PhysicalDrive0"
System::Call "kernel32::CreateFile(t r3, i ${GENERIC_READ}, i 0, i 0, i ${OPEN_EXISTING}, i 0, i 0) i .r2"
${If} $2 != ${INVALID_HANDLE_VALUE}
System::Call "kernel32::ReadFile(i r2, t .r0, i 32, i .r4, i 0) ?e"
Pop $5
DetailPrint "Return code: $5, Return value: $0"
System::Call "kernel32::CloseHandle(i r2) i.r3"
${Else}
DetailPrint "Error: CreateFile failed for \\?\PhysicalDrive0"
${EndIf}
SectionEnd

Stu
Afrow UK is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump