Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:24:44+00:00 2026-06-03T14:24:44+00:00

I have been doing some Winsock programming lately. I do not do much stuff

  • 0

I have been doing some Winsock programming lately. I do not do much stuff within the Windows SDK. I haven’t built an actual Win32 application since I was young and I did not think about it then, but now I look at some of the types that have been defined that simply wrap around other types that are platform agnostic and I wonder why anyone would use them when they didn’t have to. I do not see any advantages over using PSTR or DWORD over there native counter-parts. In the Winsock Reference
there is a page that lists all the structs and typedefs that are defined. They typedef all the structures to capital letters and I do not understand the overall strategy that was trying to be accomplished when the decision in designing the Windows SDK was made to typedef all your types to capital letters like this.

I do not understand why anyone, even when writing code in Windows would ever use the capitalized versions if they didn’t have too, simply because it seems it would make the code harder to port if ever desired in the future. I always use the native types and original Winsock structures when I can. I tried to do some searching for an answer to this question, but perhaps I cannot think how to phrase a query properly. Is there some advantage to this that I am missing? Can anyone shed some light on this for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:24:45+00:00Added an answer on June 3, 2026 at 2:24 pm

    The advantage is that the typedefs from the Windows SDK will adjust as needed. The probably best example in recent history would be DWORD_PTR which behaves correctly out of the box in x64 builds when used properly, while you would have to go through hoops in order to make this work with what you call “native types” (i.e. those from the language standard).

    Also keep in mind that some of the Winsock functions are not exact counterparts of the original BSD socket functions. So it makes sense to keep things artificially separate, be it for legacy reasons or brevity.

    The same can be said for certain Win32 types that are not defined in the language standard because they adjust depending on your build, such as LPTSTR.

    Last but not least if you ever engaged in cross-platform programming and can’t rely on (all or some) types from stdint.h for various reasons, you’ll appreciate types such as DWORD, because they imply a certain width, which is relevant whenever talking to some interface (API).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been doing some Windows Assembly Language programming lately and I realized that
I have been doing some x86 programming in Windows with NASM and I have
Lately I have been doing some numerical method programming in C. For the bug
I have been doing some research lately about best approaches to authenticating web services
I have been doing some functional programming and had a question. Perhaps I might
I have been doing some research and this seems to be not possible unless
I have been doing some catching up lately by reading about cloud hosting. For
I have been doing some statistics work with Stata recently and not enjoying it
I have been doing some reading lately one article I read was from Opera.
I have been doing some searching but have not been able to find an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.