- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: Hard 'C' Question
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "Hard 'C' Question"
Collapse
-
Put a sizeof somewhere in your code to check the size. I.e. sizeof(LPVOID), and sizeof(LPLISTENTRY) you'd expect to return 4. And also do the same for the whole structure to make sure they're the same.
If structures don't match across modules compiled seperately, then chances are it's alignment (i.e. one is set to align members to bytes, the other to align to 4 bytes). If not that, then another explanation could be if any part of the structure has #ifs which evaluate differently. sizeof should tell you if that's the case.
Leave a comment:
-
Pointers can be different lengths from one program to another. It depends on how you have compiled them.
Have you checked what byte alignment is in place? I seem to recall that intel chips allow different policies on demand. Been a while so the up-to-date experts such as scots could correct me on this one.
Leave a comment:
-
Still not working out for me.
I have a structure in Kernel mode defined as
NET_BUFFER_LIST*
now my user mode app does not know what a NET_BUFFER_LIST is so I declared it as PVOID.
All other members in the struct after the NET_BUFFER_LIST has garbled data.
So the question is
What's the difference in size between a PVOID and a NET_BUFFER_LIST*
Nothing shirley as they're both pointers?
Leave a comment:
-
Originally posted by scotspine View PostErr .... you create a U/m include file for your struct.
There it might not include your LIST_ENTRY field, you just have to
cope with this in the K/M data copy routines.
Or, you can cut and paste the LIST_ENTRY definition in to the U/m include file.
Or create a dummy version of your own devising using PVOID.
Basic C programming.
Leave a comment:
-
"so .Netters need not apply" - meaning we have no knowledge of machine code, assembly, instruction sets, direct mode addressing, indirection, bitshift etc? kids stuff!!
Leave a comment:
-
Err .... you create a U/m include file for your struct.
There it might not include your LIST_ENTRY field, you just have to
cope with this in the K/M data copy routines.
Or, you can cut and paste the LIST_ENTRY definition in to the U/m include file.
Or create a dummy version of your own devising using PVOID.
Basic C programming.
Leave a comment:
-
Originally posted by d000hg View PostOh, I thought you meant standard 64-bit ASM which seemed weird. If you are doing parallel data processing then ASM makes sense, it's really interesting.
Have you tried the Intel compiler?
Leave a comment:
-
Originally posted by d000hg View PostAssembly is a little more past it than C. What are you doing that can't be achieved using intrinsics BTW? The only time ASM seems needed these days is in SIMD, where you can get massive improvements.
Originally posted by Somewhere on da WebWatching discussions of string and macro handling in C. And complaints. C is supposed to be assembler. If that bugs you, use something else.
Leave a comment:
-
Oh, I thought you meant standard 64-bit ASM which seemed weird. If you are doing parallel data processing then ASM makes sense, it's really interesting.
Have you tried the Intel compiler?
Leave a comment:
-
Originally posted by d000hg View PostAssembly is a little more past it than C. What are you doing that can't be achieved using intrinsics BTW? The only time ASM seems needed these days is in SIMD, where you can get massive improvements.
Leave a comment:
-
Originally posted by AtW View PostSomeone is still using C? That's a blast from the past - installing C++ compiler just now as VS C++ is total tulipe when it comes to inlined assembly in 64 bit mode
Leave a comment:
-
Ten years since I did a bit of C and you have brought the fears right back posting that bit of code.
*shivers*
Leave a comment:
-
Originally posted by suityou01 View PostI have written a Kernel mode filter driver....
I am soooooooo out of this game.
Leave a comment:
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: