?
Solved

absread( ) problem

Posted on 2002-05-17
6
Medium Priority
?
460 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 200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

719 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