FASM custom Win32 header file

Source: Internet
Author: User

With the typedef macro written in the previous section, I think it is perfect. Why?

1. enhanced readability. For example, handle

2. The structure of 32 or 64 only needs one copy, because pvoid can present the pointer well, which is consistent with that of C. Switch: _ win64 equ false (or true)

3. What does struct definition not need to be seen more often? Character

For example:

 
Struct point X dd? Y dd? Ends

Change

 
Struct point X long y longends

We can see that the data type and struct type have become consistent.

 

You can place the macro in the previous section in struct. INC and save the following as win32.h.

Unicode equ false; supported ascii or Unicode (false or true) _ win64 equ falsematch = false, Unicode {include 'win32a. INC '} match = true, Unicode {include 'win32w. INC 'include 'encoding\ utf16.inc '; Wide-byte Chinese support} include 'macro \ if. INC '; the following statements describe some typical data types (this typedef can also be used for struct types) typedef dB uint8, int8, byte, Char, uchartypedef DW uint16, int16, word, wchartypedef dd uint32, int32, DWORD, long, ulongtypedef DQ uint64, int64, qword, Longlong, ulonglongtypedef DWORD bool, long, Int, hresultmatch = true, _ win64 {typedef DQ pvoid} match = false, _ win64 {typedef dd pvoid} typedef pvoid handle, pstr, pwstr, lpvoid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.