Solved

absread( ) problem

Posted on 2002-05-17
6
451 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

751 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