|
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: It's amazing to see how people cannot take care of little things like that
which little things you are talking please elaborate it.
|
|
|
|
|
Little things like using KEY_QUERY_VALUE instead of KEY_ALL_ACCESS when applicable.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I think registry write access will be only available to privileged users. If you want your application to read/write settings under any account then perhaps you should make use of app configuration file to keep track of settings.
|
|
|
|
|
Hello everyone:
Disk format is NTFS.How can I get file record like using DeviceIoControl function with the control code FSCTL_GET_NTFS_FILE_RECORD to retrieve the file record?
Any information is appreciated,thanks in advance.
|
|
|
|
|
can u please clear your question.
|
|
|
|
|
See my reply to chandu004.
|
|
|
|
|
do you mean to say,
you need to pass FSCTL_GET_NTFS_FILE_RECORD to DeviceIoControl to get a record in file?
if so, i remember, there are some in and out parameters in DeviceIOControl,
so you can retrieve the record from a file in your despatch handler code and then pass the structure out to the user layer.
but still, some clarity is required on your post.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
sorry,I mean that how to get file record from file name easily.I haven't have a good idea so far.
|
|
|
|
|
please explain your problem in detail.
it is very vague.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I mean if I only know the file name,how can I get the file record?The record structure is below:
typedef struct { LARGE_INTEGER FileReferenceNumber; DWORD FileRecordLength; BYTE FileRecordBuffer[1];
} NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
This structure can be obtained by DeviceIoControl function.Now I only have the file name,so I can't use this function.I need another method to get this struct information.
|
|
|
|
|
do you still want to use device io control for this or do you want any other way?
for example, you can use the following code to retrieve a structure from a file.
NTFS_FILE_RECORD_OUTPUT_BUFFER s;
FILE *fp;
fp=fopen(yourfilename,"rb");
fread(&s,sizeof(NTFS_FILE_RECORD_OUTPUT_BUFFER),1,fp);
fclose(fp);
or if you want to achieve this only using deviceiocontrol, then,
pass the filename to the deviceiocontrol as input parameter,
openthe file inside, read the structure and pass it as out parameter to the device io control.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
modified on Wednesday, July 22, 2009 7:24 AM
|
|
|
|
|
Thank you for your reply!I use this record information to get the layout of the file on the NTFS disk.This is called data run in the NTFS document,which is can be retrived from http://www.linux-ntfs.org/doku.php[^]
By the way, why the beginning of the file is the NTFS_FILE_RECORD_OUTPUT_BUFFER record?Could you give me some information?
|
|
|
|
|
i think you are entirely deviating the topic from what you exactly wanted.
please explain your problem very clearly and i shall definitely help you solve your problem.
explain your requirement and problem in steps.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I'm sorry for make you confused.My problem is if I know a file name(contains path),how can I get the layout of the file on a NTFS disk?
For instance,if the file name is e:\data.bin,this file was split to three parts on the disk.Now how can I get each part's starting logical cluster number,data length on the disk.The meaning of starting logical cluster number and data length is explained in the NTFS document I mentioned above.
Do I explain my question clearly?
|
|
|
|
|
denghp wrote: Any information is appreciated,thanks in advance.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I know this method,but that's not what I want.Thank you for your reply.
|
|
|
|
|
denghp wrote: ...but that's not what I want.
You asked, "How can I get file record like using DeviceIoControl function with the control code FSCTL_GET_NTFS_FILE_RECORD to retrieve the file record?" The link I provided had an example of such.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I'm tearing my hear out over this one. I am subclassing controls dynamically at runtime. I run through each child control of a window, and check it's class. If the class is "BUTTON" I want to subclass it to one of four controls:
CThemedButton : public CButton
CThemedRadioButton : public CButton
CThemedGroupBox : public CButton
CThemedCheckBox : public CButton
However, I cannot for the life of me get the correct combination of window styles to make this work in every case. My code is as below:
bool bGroupBox = (dwControlStyle&BS_GROUPBOX);<br />
bool bRadioButton = (dwControlStyle&BS_RADIOBUTTON);<br />
bool bAutoRadioButton = (dwControlStyle&BS_AUTORADIOBUTTON);<br />
bool bCheckBox = (dwControlStyle&BS_CHECKBOX);<br />
bool bAutoCheckBox = (dwControlStyle&BS_AUTOCHECKBOX);<br />
bool bPushLike = (dwControlStyle&BS_PUSHLIKE);
But I'm getting bizarre results. It seems that BS_AUTORADIOBUTTON for example is a combination of other flags, as is BS_GROUPBOX. The end result is I get some buttons that are subclassed, unless they're the default buttons, group boxes aren't picked up, check boxes are missed. The button styles aren't proper flags it seems, so I'm getting cases where bRadioButton, bAutoRadioButton and bGroupBox are all true!
Please can anyone help me here? This should be simple but it's been causing me no end of problems.
Thanks in advance,
Dave Kerr
|
|
|
|
|
Aren't Group Boxes actually Statics, not Buttons? That should help you a little, but I don't have answers for the others.
|
|
|
|
|
hello guys. I have finished my project and its working perfectly fine. however, my output is not aligned properly and needs some minor adjustment. I have played around with the setw function but i really do not know what is causing the problem. I mean, the output does not look very bad. i just feel it could be much better. anyways
1) i need to right justify the values on the far right colum(difference column).
2) i need to align the columns perfectly as they are not aligned. you could try putting in the values and you will see what i am talkin about.
how can i send the code so you can take a look at it?
|
|
|
|
|
some more clarity is required in your question.
kumamako wrote: my output is not aligned properly
where is it output to?
kumamako wrote: far right colum
column in which control?
kumamako wrote: how can i send the code so you can take a look at it?
donot put your whole code here.
just post that code where you suspect problem(not more than 10 to 12 lines).
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
You may post a relevant code snippet (don't forget to use the code block button).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kumamako wrote: however, my output is not aligned properly and needs some minor adjustment. I have played around with the setw function...
Which is the right manipulator to use.
kumamako wrote: ...but i really do not know what is causing the problem.
What problem?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
#ifndef BYTE // For OS X -ers
#define unsigned char BYTE
#define unsigned char * LPBYTE
#endif
#include <vector>
#include <algorithm>
void separate(vector< pair<LPBYTE, LPBYTE> >& retVec, LPBYTE data, LPBYTE delimeter, bool *bComplete = 0) {
retVec.clear();
if (bComplete) *bComplete = false;
if (!data)
return;
LPBYTE dataEnd = data + sizeof(data);
LPBYTE delEnd = delimeter + sizeof(delimeter);
size_t delSize = distance(delimeter, delEnd);
LPBYTE found = std::search(data, dataEnd, delimeter, delEnd);
if (found == delEnd)
return;
cout << "In separate(...)\n";
if (data[0] == delimeter[0])
cout << "data[0] == delimeter[0]\n";
if (found == data)
cout << "Found == data.\n(" << found[0] << " == " << data[0] << ")\n";
if (found != data)
cout << "Found != data; found == data[" << distance(data, found) << "].\n";
return;
};
int main()
{
BYTE buffer[] = {',', '1', '2', '3', ',', '4', '5', '6', ',', '7', '8', '9', ',', 0};
BYTE del = ',';
bool bComp = true;
LPBYTE found = std::search(&buffer[0], &buffer[0] + sizeof(buffer), &del, &del + sizeof(del));
if (found == &buffer[0])
cout << "found == &buffer[0]\n";
else
cout << "found == &buffer[" << distance(&buffer[0], found) << "]\n";
vector< pair<LPBYTE, LPBYTE> > lpb;
separate(lpb, buffer, &del, &bComp);
return 0;
} Output:
found == &buffer[0]
In separate(...)
data[0] == delimeter[0]
Found != data; Found == data[4]
When I search from within main() , the leading comma is found, but once I pass the data & delimeter to separate() , it misses the leading comma and finds the next one.. obviously I'm missing something - can anyone spot what it is?
Your assistance is greatly appreciated!
MZR
|
|
|
|