Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
int main(int argc, char *argv[])
{
    long file_size = (long) DEFAULT_FILE_SIZE;
   
  //  printf("%d",sizeof(file_size));
    unsigned char drive_path[256];
    char *opts[256]; 
    FILE *f;
    
    #if (OS == 0)
       fprintf(stderr, "\nError: current OS is not supported.");
       goto exit;
    #endif
    //read input params
    if (get_opts(argc, argv, drive_path) != 0){
       goto exit;
    }
    
    if (can_write(drive_path) != 0){
       fprintf(stderr, "\nError: unable to access/write to drive \"%s\"", drive_path);
       goto exit;                          
    }
   // fseek(&drive_path, 0, SEEK_END);
    BOOL ret; 
    DWORD SectorsPerCluster;
    DWORD BytesPerSector;
    DWORD NumberOfFreeClusters;
    DWORD TotalNumberOfClusters;
    DWORD TotalSpace, TotalSpaceLeft;
    GetFreeSpace(drive_path);
    TotalSpace = BytesPerSector * SectorsPerCluster*TotalNumberOfClusters;

    TotalSpaceLeft=BytesPerSector * SectorsPerCluster * NumberOfFreeClusters;

    printf("  Drive: Total Space=%u bytes Space Left=%u Bytes\n",TotalSpace,TotalSpaceLeft);

   // TotalSpace = (double)diskfree.sectors_per_cluster * (double)diskfree.bytes_per_sector *(double)diskfree.total_clusters / (1024.0*1024.0);


    fprintf(stdout,"\nsize of drive : %d",TotalSpace);
    fprintf(stdout,"\nsize of drive trilok : %s",drive_path);
    char D;
    fprintf(stdout,"\nsize of drive : %d",sizeof(drive_path));
    //wipe free space
    fprintf(stdout, "\nPress ENTER to start wiping free space of drive \"%s\"", drive_path);
    getchar();
    wipe_wrap(drive_path, file_size);
    
    exit:
    
    fprintf(stdout, "\n\nWebsite: https://sourceforge.net/projects/simpledrivewipe/");
	 fprintf(stdout, "\nPress ENTER to quit.");
	 fflush(stdout);
	 
	 getchar();
     ////////////////////////trilok//////////////////////////////
     
     
     
     
        
    return 0;
}




Please help me this is very urgent.Thanks
........
Posted
Updated 24-Oct-11 22:06pm
v4
Comments
Richard MacCutchan 25-Oct-11 4:06am    
It's not urgent to anyone but you.

1 solution

Hi dear mahdi
my name is mahdi too.
have a good time
this page from MSDN can help you.
see this:

http://msdn.microsoft.com/en-us/library/aa364935(VS.85).aspx[^]

good luck
god with you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900