Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:19:04+00:00 2026-05-27T20:19:04+00:00

The IOCTL_DISK_GET_DRIVE_GEOMETRY example code of Microsoft gives the expected results for the hard disk.

  • 0

The IOCTL_DISK_GET_DRIVE_GEOMETRY example code of Microsoft gives the expected results for the hard disk.

The SD card is drive F: and has no file system. The card was previously written by an 8 bit microcontroller and file system is out of the question. In the windows explorer, the SD card size is displayed correctly as 1886 MB. However when I run the program I get 0.01 GB.

Is the example code correct? I slightly changed the original code, the changed one is here.

Can it be an issue with Mingw? I doubt, it works fine for the hard disk. It is mingw32 gcc 4.6.1 on WinXP SP2. The resulting program is run on Win7. I am using Linux and I have very limited access to native Win7.

How can I figure out the size of the SD card without file system?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:19:05+00:00Added an answer on May 27, 2026 at 8:19 pm

    As pointed out by Hans Passant, the IOCTL_DISK_GET_LENGTH_INFO should be passed to DeviceIoControl.

    Everything works fine if the CreateFile remarks concerning physical disks and volumes are followed. The resulting code is here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get specifications of hard disk on both Win and *nix machines.
I am facing error C2065: 'IOCTL_NDISUIO_OPEN_DEVICE' : undeclared identifier error in beneath code. Where
I have long file with the following list: /drivers/isdn/hardware/eicon/message.c//add_b1() /drivers/media/video/saa7134/saa7134-dvb.c//dvb_init() /sound/pci/ac97/ac97_codec.c//snd_ac97_mixer_build() /drivers/s390/char/tape_34xx.c//tape_34xx_unit_check() (PROBLEM)/drivers/video/sis/init301.c//SiS_GetCRT2Data301() /drivers/scsi/sg.c//sg_ioctl()
I need to get the file descriptor to use in ioctl() calls for an
I'd like to know if a fd has data available for reading. I have
I'm coding a UDP datagram receiver in C++ on the QNX operating system and
I need to access a serial port from within my app (the app has
In every example and discussion I run across in the context of BSD socket
I'm trying to do direct disk access on Win CE (5.0), and I need
I am using the KbFilter example in the WDK, trying to send an IOCTL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.