473,406 Members | 2,293 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,406 software developers and data experts.

how to get the numerical value of a constant from Winioctl.h

I want to declare in vb:

FSCTL_GET_COMPRESSION

FSCTL_SET_COMPRESSION

which are declared in Winioctl.h.

#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS)

#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)

but I can't figure out what the numerical value is.

Do you know how to do that?


Jan 10 '08 #1
6 2911
I want to declare in vb:
FSCTL_GET_COMPRESSION
FSCTL_SET_COMPRESSION
which are declared in Winioctl.h.
but I can't figure out what the numerical value is.
Do you know how to do that?
an internet search yielded:

0x0009003C, FSCTL_GET_COMPRESSION
0x0009C040, FSCTL_SET_COMPRESSION

Jan 10 '08 #2
Thanks

"AMercer" <AM*****@discussions.microsoft.comwrote in message
news:B1**********************************@microsof t.com...
>I want to declare in vb:
FSCTL_GET_COMPRESSION
FSCTL_SET_COMPRESSION
which are declared in Winioctl.h.
but I can't figure out what the numerical value is.
Do you know how to do that?

an internet search yielded:

0x0009003C, FSCTL_GET_COMPRESSION
0x0009C040, FSCTL_SET_COMPRESSION

Jan 11 '08 #3
"Academia" <ac************@a-znet.comschrieb:
>I want to declare in vb:

FSCTL_GET_COMPRESSION

FSCTL_SET_COMPRESSION

which are declared in Winioctl.h.

#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS)

#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)

but I can't figure out what the numerical value is.
\\\

' Values taken from "Winioctl.h".
Private Const FILE_DEVICE_FILE_SYSTEM As Int32 = &H9
Private Const METHOD_BUFFERED As Int32 = &H0
Private Const FILE_ANY_ACCESS As Int32 = &H0

Private ReadOnly FSCTL_GET_COMPRESSION As Int32 = _
CTL_CODE( _
FILE_DEVICE_FILE_SYSTEM, _
15, _
METHOD_BUFFERED, _
FILE_ANY_ACCESS _
)

Private Function CTL_CODE( _
ByVal DeviceType As Int32, _
ByVal [Function] As Int32, _
ByVal Method As Int32, _
ByVal Access As Int32 _
) As Int32
Return DeviceType << 16 Or Access << 14 Or [Function] << 2 Or Method
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Jan 11 '08 #4

What is "Private Function CTL_CODE"?
Is that a function you wrote?

Is there a macro in the .h file that does that for C programs?

Is there any area of VB.NET that you don't know about :-)
Thanks
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:ul**************@TK2MSFTNGP02.phx.gbl...
"Academia" <ac************@a-znet.comschrieb:
>>I want to declare in vb:

FSCTL_GET_COMPRESSION

FSCTL_SET_COMPRESSION

which are declared in Winioctl.h.

#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15,
METHOD_BUFFERED, FILE_ANY_ACCESS)

#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16,
METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)

but I can't figure out what the numerical value is.

\\\

' Values taken from "Winioctl.h".
Private Const FILE_DEVICE_FILE_SYSTEM As Int32 = &H9
Private Const METHOD_BUFFERED As Int32 = &H0
Private Const FILE_ANY_ACCESS As Int32 = &H0

Private ReadOnly FSCTL_GET_COMPRESSION As Int32 = _
CTL_CODE( _
FILE_DEVICE_FILE_SYSTEM, _
15, _
METHOD_BUFFERED, _
FILE_ANY_ACCESS _
)

Private Function CTL_CODE( _
ByVal DeviceType As Int32, _
ByVal [Function] As Int32, _
ByVal Method As Int32, _
ByVal Access As Int32 _
) As Int32
Return DeviceType << 16 Or Access << 14 Or [Function] << 2 Or Method
End Function
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 11 '08 #5
"Academia" <ac************@a-znet.comschrieb:
What is "Private Function CTL_CODE"?
Is that a function you wrote?
Yes, it's a translation of the 'CTL_CODE' C macro which is used in the
header file to construct the defines' values.
Is there a macro in the .h file that does that for C programs?
Yes:

\\\
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 12 '08 #6
thanks again

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
"Academia" <ac************@a-znet.comschrieb:
>What is "Private Function CTL_CODE"?
Is that a function you wrote?

Yes, it's a translation of the 'CTL_CODE' C macro which is used in the
header file to construct the defines' values.
>Is there a macro in the .h file that does that for C programs?

Yes:

\\\
#define CTL_CODE( DeviceType, Function, Method, Access )
( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)
\
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 12 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: 2mc | last post by:
I'm new to Python and to Numerical Python. I have a program written in another program that used arrays extensively. I'm trying to convert to Python. Assume an array in Numerical Python, the...
1
by: dont bother | last post by:
Hey, I have these attributes: index which is a numerical value value vector which is a numerical float value and I want to concatenate like this:
5
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I need to try and make sure that a given string is a valid numerical value (not just int, or int32 - it could be float, decimal, what have you). VB.NET has a neat "IsNumeric" function -...
12
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information would be useful to unify syntax Polo
2
by: Ian Eagland | last post by:
Hi I am just starting on Visual C (2003) from a VB background. I find it easier to learn by actually programming. I have fallen over at the first hurdle. How do you extract a numerical value...
10
by: Parachute | last post by:
Using Borland Builder 6, I get numerical overflow when running a small programme without CodeGuard ("exp: OVERFLOW error"). The programme does not give any error messages when CodeGuard is...
2
by: farah727rash | last post by:
Hi all, I am trying to find the numerical value of a string that stores a two digit number. I have found the numerical value of a char as: char character; cin >> character; int number =...
8
by: farah727rash | last post by:
Hi all, I am trying to find the numerical value of a string that stores a two digit number. I have found the numerical value of a char as: char character; cin >character; int number =...
1
Blackout
by: Blackout | last post by:
Hi, I'm new to c and need to write a program that prints the numerical value of eof but the problem is I don't even know what the numerical value of eof is or how im supposed to find it!!! I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.