Error 21 Device Not Ready Getting Device Geometry
and then the application crashes when I click OK. I'm using version 0.4 because I couldn't get 0.5 to work in Windows 7 (could not see the device in the device list). Is there any way that I can get this to work? [Edit] Got this working by closing all open explorer windows. Question information Language: English Edit question Status: Answered For: Image Writer Edit question Assignee: No assignee Edit question Last query: 2012-03-24 Last reply: 2012-03-26 Related bugs Link existing bug Related FAQ: Error 21 - The device is not ready. Link to a FAQ Jeff B (skydiver38) said on 2012-03-26: #1 Glad you got it working. Windows Explorer being open will prevent WinImageWriter from getting a lock on the device, which is necessary for it to write the image. Jeff B (skydiver38) said on 2012-03-26: #2 Jeff B suggests this article as an answer to your question: FAQ #1928: “Error 21 - The device is not ready.”. Can you help with this problem? Provide an answer of your own, or ask William Wall for more information if necessary. History Link existing bug Create bug report Link to a FAQ Create a new FAQ To post a message you must log in. Ask a question Edit question Subscribers Subscribe Subscribe someone else • Take the tour • Read the guide © 2004-2016 CanonicalLtd. • Terms of use • Contact Launchpad Support • Blog • Careers • System status • r18227 (Get the code!)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, https://answers.launchpad.net/win32-image-writer/+question/191601 helping each other. Join them; it only takes a minute: Sign up Why does DeviceIoControl throw error 21 (Device Not Ready) from C# when the equivalent in C works fine? up vote 4 down vote favorite I'm trying to send an IOCTL_SERVICE_REFRESH command to the GPS Intermediate Driver service using C# like this: handle = CreateFile("GPD0:", GENERIC_READ, FILE_SHARE_READ http://stackoverflow.com/questions/4524482/why-does-deviceiocontrol-throw-error-21-device-not-ready-from-c-sharp-when-the | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero); if (handle.ToInt32() == INVALID_HANDLE_VALUE) { rc = Marshal.GetLastWin32Error(); return rc; } int numBytesReturned = 0; rc = DeviceIoControl( handle, IOCTL_SERVICE_REFRESH, null, 0, null, 0, ref numBytesReturned, IntPtr.Zero); int error = Marshal.GetLastWin32Error(); GetLastWin32Error always gives me error 21 (device not ready). However, the equivalent call when made from C++ works fine: HANDLE hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hGPS != INVALID_HANDLE_VALUE) { BOOL ret = DeviceIoControl(hGPS,IOCTL_SERVICE_REFRESH,0,0,0,0,0,0); DWORD err = GetLastError(); } I suspected a problem with the PInvoke signatures, but I can't seem to find anything wrong here: [DllImport("coredll.dll", EntryPoint = "DeviceIoControl", SetLastError = true)] public static extern int DeviceIoControl( IntPtr hDevice, uint dwIoControlCode, byte[] lpInBuffer, int nInBufferSize, byte[] lpOutBuffer, int nOutBufferSize, ref int lpBytesReturned, IntPtr lpOverlapped); [DllImport("coredll.dll", SetLastError = true)] public static extern IntPtr CreateFile( String lpFileName, uint dwDesiredAccess, uint dwShareMode, IntPtr attr, uint dwCreationDisposition, uint dwFlagsAndAttributes, IntPtr hTemplateFile); What am I missing here? c# c windows-mobile gps pinvoke share|improve this question asked Dec 24 '10 at 5:4
« previous next » Print Pages: [1] Go Down Author Topic: Error 21 The Device Is Not Ready, Avast Free new install (Read 3031 times) 0 Members and 1 Guest are https://forum.avast.com/index.php?topic=97807.0 viewing this topic. Decalyn Newbie Posts: 2 Error 21 The Device Is Not http://support.macrium.com/topic.asp?TOPIC_ID=817 Ready, Avast Free new install « on: April 27, 2012, 04:58:29 PM » Hello! Fairly new user here. I'll try to be as detailed as possible ^_^Problem: I am experiencing "SOME FILES COULD NOT BE SCANNED" post-scan. The scan results page then lists quite a few directories that I would assume error 21 are quite important to scan, with the following text in the Status field: "Error: The device is not ready (21)".Avast Version: avast! FREE ANTIVIRUS 7.0.1426Operating System: Windows 7 Home Premium 64-bit, Service Pack 1Other Programs Installed (or recently uninstalled): Microsoft Security Essentials - Properly removed prior to Avast! installationWindows Defender - Currently disabledMalwarebytes - For separate scans, not currently runningCCleaner - For separate scans, error 21 device not currently runningMore details on the issue:I installed and updated Avast and it's definitions last night. I set it to do a full scan while I slept, and awoke to the results this morning. No viruses were found, however the results page lists several directories that were not scanned because the device was "not ready".At first I thought it may have been a permissions issue, but even the public folders are in the list.I would like to stress that these directories are all on my C drive, and not on an external drive. The Accounts on the machine are: Windows 7's hidden true admin account (not enabled on the login screen, for obvious reasons)ADMIN - A separate administrator account that I can use when I don't want to deal with the bells and whistles in my personal user account, admin levelUSER1 - My account, admin level USER2 - My husband's account, basic userPUBLIC - The public folders (not a user account, but listed in the errors)Folders Affected By This IssueC:\Documents and SettingsC:\Program Data\Application DataC:\Program Data\DesktopC:\Program Data\DocumentsC:\Program Data\ FavouritesC:\Program Data\Start MenuC:\Program Data\TemplatesC:\Users\All UsersC:\Users\DefaultC:\Users\Default\AppData\Local\Application DataC:\Users\Default\AppData\Local\HistoryC:\Users\Default\AppData\Local\Temporary Internet FilesC:\Users\Default\Application DataC:\Users\Default\CookiesC:\Users\Default\Documents\My MusicC:\Users\Default\Documents\My PicturesC:\Users\Default\Documents\My VideosC:\Users\Default\Local SettingsC:\Users\Default\My DocumentsC:\Users
Active Topics | Members | Search | FAQ Username: Password: Save Password Forgot your Password? All Forums Reflect v4 Disk Imaging Error 21 , Error 2 Forum Locked Printer Friendly Author Topic Santa90 Starting Member USA 1 Posts Posted-January 07 2009: 22:22:13 Backup aborted! - Unable to read from disk - Error Code 2 - The system cannot find the file specified.Backup aborted! - Unable to read from disk - Error Code 21 - The device is not ready.In 4 attempts to image the C drive onto another harddrive I received 2 of each of the messages. I'm just doing a full image and these messages come after 10 - 15% completion. Nick Moderator United Kingdom 6302 Posts Posted-January 07 2009: 23:09:10 HiHave a look in your Windows event log for more information. If you see any VSS (Shadow Copy Errors) then have a look here: http://www.macrium.com/blog/2008/09/26/HowToTroubleshootMicrosoftVolumeShadowCopyServiceVSSErrors.aspx Hope this helps Nick - Macrium Support Topic Forum Locked Printer Friendly Jump To: Select Forum Reflect v5 Wish List Rescue CD Installation File Backup Disk Imaging Community Reflect v4 Installation Disk Imaging File Backup Rescue CD Wish List -------------------- Home Active Topics Frequently Asked Questions Member Information Search Page Macrium Support Forum © Paramount Software UK Ltd This page was generated in 0.84 seconds. Snitz Forums 2000 Home | Personal | Business | Downloads | Testimonials | Contact Us | Support | Legal © 2016 Paramount Software UK Ltd. All rights reserved