-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix x86 packing issues in System.Data.OleDb #33899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0d58cb0
fix x86 packing issues
1a28c9f
revert unintentional change
1419b34
Fix formatting
saurabh500 435296a
Inline static initializations
6330571
Fix bugs in static intialization
90921e0
Move all code to OleDbStruct.cs
6c6c43d
Rename the utility Type
282f1e5
Inlining method returns
7f1e38a
add tests to test the x86 APIs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
src/libraries/System.Data.OleDb/src/ArchitectureSpecificHelpers.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace System.Data.OleDb | ||
| { | ||
| internal interface ItagDBPROPINFO | ||
|
saurabh500 marked this conversation as resolved.
Outdated
|
||
| { | ||
| int dwPropertyID { get; } | ||
| int dwFlags { get; } | ||
| int vtType { get; } | ||
| object vValue { get; } | ||
| string pwszDescription { get; } | ||
| } | ||
|
|
||
| internal interface ItagDBPROP | ||
| { | ||
| OleDbPropertyStatus dwStatus { get; } | ||
| object vValue { get; } | ||
| int dwPropertyID { get; } | ||
| } | ||
|
|
||
| internal sealed partial class tagDBPROPINFO_x86 : ItagDBPROPINFO | ||
| { | ||
| int ItagDBPROPINFO.dwPropertyID => this.dwPropertyID; | ||
|
|
||
| int ItagDBPROPINFO.dwFlags => this.dwFlags; | ||
|
|
||
| int ItagDBPROPINFO.vtType => this.vtType; | ||
|
|
||
| object ItagDBPROPINFO.vValue => this.vValue; | ||
|
|
||
| string ItagDBPROPINFO.pwszDescription => this.pwszDescription; | ||
| } | ||
|
|
||
| internal sealed partial class tagDBPROPINFO : ItagDBPROPINFO | ||
| { | ||
| int ItagDBPROPINFO.dwPropertyID => this.dwPropertyID; | ||
|
|
||
| int ItagDBPROPINFO.dwFlags => this.dwFlags; | ||
|
|
||
| int ItagDBPROPINFO.vtType => this.vtType; | ||
|
|
||
| object ItagDBPROPINFO.vValue => this.vValue; | ||
|
|
||
| string ItagDBPROPINFO.pwszDescription => this.pwszDescription; | ||
|
|
||
| } | ||
|
|
||
| internal sealed partial class tagDBPROP_x86 : ItagDBPROP | ||
| { | ||
| OleDbPropertyStatus ItagDBPROP.dwStatus => this.dwStatus; | ||
|
|
||
| object ItagDBPROP.vValue => this.vValue; | ||
|
|
||
| int ItagDBPROP.dwPropertyID => this.dwPropertyID; | ||
| } | ||
|
|
||
| internal sealed partial class tagDBPROP : ItagDBPROP | ||
| { | ||
| OleDbPropertyStatus ItagDBPROP.dwStatus => this.dwStatus; | ||
|
|
||
| object ItagDBPROP.vValue => this.vValue; | ||
|
|
||
| int ItagDBPROP.dwPropertyID => this.dwPropertyID; | ||
| } | ||
|
|
||
| internal static class ArchitectureSpecificHelpers | ||
| { | ||
| internal static ItagDBPROPINFO CreateTagDbPropInfo() | ||
|
saurabh500 marked this conversation as resolved.
Outdated
saurabh500 marked this conversation as resolved.
Outdated
|
||
| { | ||
| if (ODB.IsRunningOnX86) | ||
| { | ||
| return new tagDBPROPINFO_x86(); | ||
| } | ||
| else | ||
| { | ||
| return new tagDBPROPINFO(); | ||
| } | ||
| } | ||
|
|
||
| internal static ItagDBPROP CreateTagDbProp(int propertyID, bool required, object value) | ||
| { | ||
| if (ODB.IsRunningOnX86) | ||
| { | ||
| return new tagDBPROP_x86(propertyID, required, value); | ||
| } | ||
| else | ||
| { | ||
| return new tagDBPROP(propertyID, required, value); | ||
| } | ||
| } | ||
|
|
||
| internal static ItagDBPROP CreateTagDbProp() | ||
| { | ||
| if (ODB.IsRunningOnX86) | ||
| { | ||
| return new tagDBPROP_x86(); | ||
| } | ||
| else | ||
| { | ||
| return new tagDBPROP(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.