Solved

absread( ) problem

Posted on 2002-05-17
6
447 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

837 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