DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: getvolumeinformationa always returning 0

  1. #1
    Join Date
    Jan 2008

    getvolumeinformationa always returning 0

    Alright so here's the function:
    DWORD dwVolSerial;
    BOOL bIsRetrieved;
    export double blahblah()
        bIsRetrieved = GetVolumeInformationA("C:\\",NULL,0,&dwVolSerial,NULL,NULL,NULL,0);
       if (bIsRetrieved) {
          //printf("Serial number of drive C is %X\n",dwVolSerial);
          return((double) dwVolSerial);
       } else {
          //printf("Could not retrieve\n");
    Anyway it's supposed to return the hdd's serial number but it's always returning 0. Anyone know why?

  2. #2
    Join Date
    Dec 2003
    my computer has no idea what "export" is but once I pulled that word off the function it worked like a charm. At least the print statements inside it did. The number it found matched the one that "dos" prints from the "dir" command. (try that in an empty folder and it will print the SN).

    I do not know if perhaps you are messing it up by casting it into a double. Did you do this?

    double d = blahblah();
    printf("%x\n", d); /// BIG MISTAKE, D IS A DOUBLE %X IS INTEGER

    or something along those lines???

Similar Threads

  1. Returning ID from Insert with Oracle 10g
    By warren in forum VB Classic
    Replies: 0
    Last Post: 08-04-2006, 03:03 PM
  2. Datagrid cell returning "" in ItemDataBound
    By Billkamm in forum ASP.NET
    Replies: 1
    Last Post: 03-21-2006, 05:48 PM
  3. Assignment Operator, Returning const reference
    By codemonkey32 in forum C++
    Replies: 6
    Last Post: 02-06-2006, 05:39 PM
  4. Returning multiple ADO recordset
    By John K. in forum VB Classic
    Replies: 0
    Last Post: 02-07-2003, 07:52 PM
  5. Returning Recordset from Stored Procedure
    By Paul in forum Database
    Replies: 2
    Last Post: 09-21-2001, 01:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center