473,837 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determining windows version during compile...

Hi all,

I'm doing some custom RAS work and I need to marshal the struct definition
below. The marshaling is no problem, however how can I acheive the effect of
the windows version pre-processor check in C#?

typedef struct tagRASDIALEXTEN SIONS {
DWORD dwSize;
DWORD dwfOptions;
HWND hwndParent;
ULONG_PTR reserved;
#if (WINVER >= 0x500)
ULONG_PTR reserved1;
RASEAPINFO RasEapInfo;
#endif
} RASDIALEXTENSIO NS;
Nov 17 '05 #1
1 1130
Richard,

I wouldn't bother doing the check. Rather, I would declare the
structure whole, and then set the dwSize field appropriately depending on
what operating system you are running on when the call is made. It will
cost a little, since you might marshal over extra data that will not be
populated, but it shouldn't affect anything else (assuming that a pointer to
this structure is passed, the call stack shouldn't be affected, and the
other parameters won't be shifted in memory into a place where the function
doesn't expect them).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:16******** *************** ***********@mic rosoft.com...
Hi all,

I'm doing some custom RAS work and I need to marshal the struct definition
below. The marshaling is no problem, however how can I acheive the effect
of
the windows version pre-processor check in C#?

typedef struct tagRASDIALEXTEN SIONS {
DWORD dwSize;
DWORD dwfOptions;
HWND hwndParent;
ULONG_PTR reserved;
#if (WINVER >= 0x500)
ULONG_PTR reserved1;
RASEAPINFO RasEapInfo;
#endif
} RASDIALEXTENSIO NS;

Nov 17 '05 #2

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

Similar topics

2
5427
by: Luca | last post by:
I have the following problem: I'm developing a system where there are some processes that communicate each other via message queues; the message one process can send to another process is as follows: ****************************************** struct ST_MSG { int iType; char aData; }
12
2472
by: johny smith | last post by:
I am trying to figure out a way to print the address of what called a certain function once inside the function. I am assuming that this information is on the stack somewhere. But can someone give me some advice? I don't know where to go to look this information up. Do I need to access the stack, and hence do some kind of inline assembly code to get the calling address?
3
7491
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I try to connect to my PostgreSQL server using PHPPgAdmin, I
27
3988
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
0
9843
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9683
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10630
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7005
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4476
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.