Solved

absread( ) problem

Posted on 2002-05-17
6
454 Views
Last Modified: 2010-08-05
i am not able to access the hard disk sectors with the absread() function  of borland turboc C++.
errno states that the function number is not correct.i also tried to use int25h which absread uses but all in vain.please help.thanks
0
Comment
Question by:vinayak_j
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 7016866
What is the operating system that you are using?  In protected-mode, multithreaded O/Ses like Windows, low-level disk access is disallowed in order to prevent disk corruption.

Sometimes you can lock a disk before attempting low-level access.

-- Dan
0
 

Author Comment

by:vinayak_j
ID: 7017780
thanks DanRollins.I am using win98SE can you throw more light on locking disks the way i should access them.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 total points
ID: 7018316
You can look into the DeviceIoControl Win32 API.  It provides access to low-level information about a hard disk.  To access this function, you need to use the CreateFile() API as decribed here (section about physical drives):

http://msdn.microsoft.com/library/en-us/fileio/filesio_7wmd.asp

And the FSCTL_LOCK_VOLUME Ioctl code that is described here:

http://search.microsoft.com/gomsuri.asp?n=8&c=rp_Results&siteid=us/dev&target=http://msdn.microsoft.com/library/en-us/fileio/fsys_02w5.asp

The most common use for sector-level disk writing is to cause damage to people's hard disk as part of a virus or trojan horse type program.  So don't expect me to hold your hand.  If you have a real and legitimate interest in low-level disk I/O these links will get you started.

-- Dan
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:Shivshankar
ID: 7019668
Your win98SE might have formatted the hard-disk in FAT32 file format.

absread are so old that they don't know anything beyond FAT16. This might be the reason.
0
 
LVL 11

Expert Comment

by:griessh
ID: 7178799
Dear vinayak_i

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "DanRollins"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/


PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7199802
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question