473,385 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SetFilePointerEx doesn't seek my memory flash, why is this?

Hello...I've a problems trying to move the pointer forward.. I'm trying to read my flash memory as array of bytes... Using SetFilePointerEx API function I've already did it, but, the problems is that it always read begening at 0 byte, I can't begin with offset of 512 bytes for example... why is this.....Note: it works pretty well seeking a file like .txt file. Some help.. please....I really need some help..

My code:

Expand|Select|Wrap|Line Numbers
  1. SafeFileHandle ptrFile = CreateFile("\\\\.\\u:", DesiredAccess.GENERIC_READ | DesiredAccess.GENERIC_WRITE, ShareMode.FILE_SHARE_READ_AND_WRITE, IntPtr.Zero, CreationDisposition.OPEN_EXISTING, FlagsAndAttributes.FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
  2.  
  3.         byte[] buffer = new byte[512];
  4.  
  5.         uint readed = 0;
  6.         try
  7.         {
  8.            bool retor = SetFilePointerEx(ptrFile, 512, IntPtr.Zero,      MoveMethod.FILE_BEGIN);
  9.         }
  10.         catch (Exception)
  11.         {
  12.            throw new Win32Exception(Marshal.GetLastWin32Error());
  13.         }
  14.  
  15.         bool b = ReadFile(ptrFile, buffer,512 , out readed, IntPtr.Zero)
;
Jul 5 '11 #1
0 1756

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jason | last post by:
this is my code and what i get... i'm accessing this through this url http://192.168.0.2/php/test2/test.php?user=me@test.ca&subject=test it grabs the correct stuff from the database, but...
1
by: Kuba Florczyk | last post by:
Hi I've got a flash.ocx on a form in which i want play a movie, under this movie i've got a image. Everything is ok, but in flash movie some objects got alpha <> 100 and thru flash i should see...
24
by: Benjamin Doyle | last post by:
In Chip Irek's "A PRIMER ON USING DB2 WITH .NET" (www.15seconds.com), he states that "...ODBC doesn't support DB2 stored procedures. So if you are building an application heavily dependant on...
0
by: Pyramis | last post by:
Sometimes (once or twice by day) ISS raise a out of memory exception and get a dead lock state. I have seen that Garbage Collector doesn´t free memory when i don't use it, so Virtual Bytes grow and...
3
by: VMI | last post by:
I asked this question some time ago, and I received a reply, but I never followed up on the suggestion. That's why I'm posting again... I'm trying to add a Macromedia Flash movie to my C# windows...
11
by: seberino | last post by:
Suppose a C extension locally built an array of PyObject* 's as follows... my_array = malloc(n * sizeof(PyObject*)); for (i = 0; i < n; i++) { my_array = PyList_New(0); } Q1: Must I do a...
18
by: gconrads | last post by:
OK, today is my twofer special on js questions. BTW: the method used here is working in Firefox I'm working on a script that switches the width of a Flash movie between 100% and 812 pixels...
8
by: jimmarq | last post by:
I have a button click event on my main application window that opens a form. The form has a lot of controls, loads a lot of data, and uses a lot of memory. When I close the form the memory is no...
17
by: Cesar | last post by:
Hello people. I'm having a Winform app that contains a webbrowser control that keeps navigating from one page to another permanentrly to make some tests. The problem I'm having is that after a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.