Skip to content
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

Some functions and structs are missing Ansi/Unicode attributes #1817

Closed
halildurmus opened this issue Jan 11, 2024 · 1 comment
Closed

Some functions and structs are missing Ansi/Unicode attributes #1817

halildurmus opened this issue Jan 11, 2024 · 1 comment
Assignees

Comments

@halildurmus
Copy link
Contributor

halildurmus commented Jan 11, 2024

I noticed that some functions and structs are missing Ansi/Unicode attributes (see #711).

See Affected APIs

Affected functions

CMCreateProfile
CMCreateProfileW
CMCreateTransform
CMCreateTransformW
CMCreateTransformExt
CMCreateTransformExtW
DbgHelpCreateUserDump
DbgHelpCreateUserDumpW
EnumDirTree
EnumDirTreeW
EnumerateLoadedModulesEx
EnumerateLoadedModulesExW
FindDebugInfoFileEx
FindDebugInfoFileExW
FindExecutableImageEx
FindExecutableImageExW
FreeAddrInfoEx
FreeAddrInfoExW
GetEnvironmentStrings
GetEnvironmentStringsW
Module32First
Module32FirstW
Module32Next
Module32NextW
Process32First
Process32FirstW
Process32Next
Process32NextW
RatingAccessDeniedDialog
RatingAccessDeniedDialogW
RatingAccessDeniedDialog2
RatingAccessDeniedDialog2W
RatingCheckUserAccess
RatingCheckUserAccessW
RatingEnable
RatingEnableW
RatingObtainQuery
RatingObtainQueryW
RatingSetupUI
RatingSetupUIW
RoOriginateError
RoOriginateErrorW
RoTransformError
RoTransformErrorW
SQLSetDescField
SQLSetDescFieldW
SQLSetStmtAttr
SQLSetStmtAttrW
SearchTreeForFile
SearchTreeForFileW
SymAddSymbol
SymAddSymbolW
SymDeleteSymbol
SymDeleteSymbolW
SymEnumLines
SymEnumLinesW
SymEnumSourceFiles
SymEnumSourceFilesW
SymEnumSourceLines
SymEnumSourceLinesW
SymEnumSymbols
SymEnumSymbolsW
SymEnumSymbolsEx
SymEnumSymbolsExW
SymEnumSymbolsForAddr
SymEnumSymbolsForAddrW
SymEnumTypes
SymEnumTypesW
SymEnumTypesByName
SymEnumTypesByNameW
SymEnumerateSymbols
SymEnumerateSymbolsW
SymFindDebugInfoFile
SymFindDebugInfoFileW
SymFindExecutableImage
SymFindExecutableImageW
SymFindFileInPath
SymFindFileInPathW
SymFromAddr
SymFromAddrW
SymFromIndex
SymFromIndexW
SymFromInlineContext
SymFromInlineContextW
SymFromName
SymFromNameW
SymFromToken
SymFromTokenW
SymGetHomeDirectory
SymGetHomeDirectoryW
SymGetLineFromInlineContext
SymGetLineFromInlineContextW
SymGetModuleInfo
SymGetModuleInfoW
SymGetScope
SymGetScopeW
SymGetSearchPath
SymGetSearchPathW
SymGetSourceFile
SymGetSourceFileW
SymGetSourceFileChecksum
SymGetSourceFileChecksumW
SymGetSourceFileFromToken
SymGetSourceFileFromTokenW
SymGetSourceFileFromTokenByTokenName
SymGetSourceFileFromTokenByTokenNameW
SymGetSourceFileToken
SymGetSourceFileTokenByTokenName
SymGetSourceFileTokenByTokenNameW
SymGetSourceFileTokenW
SymGetSourceVarFromToken
SymGetSourceVarFromTokenW
SymGetSymbolFile
SymGetSymbolFileW
SymGetTypeFromName
SymGetTypeFromNameW
SymInitialize
SymInitializeW
SymLoadModuleEx
SymLoadModuleExW
SymMatchFileName
SymMatchFileNameW
SymNext
SymNextW
SymPrev
SymPrevW
SymSearch
SymSearchW
SymSetHomeDirectory
SymSetHomeDirectoryW
SymSetSearchPath
SymSetSearchPathW
SymSrvDeltaName
SymSrvDeltaNameW
SymSrvGetFileIndexInfo
SymSrvGetFileIndexInfoW
SymSrvGetFileIndexString
SymSrvGetFileIndexStringW
SymSrvGetFileIndexes
SymSrvGetFileIndexesW
SymSrvGetSupplement
SymSrvGetSupplementW
SymSrvIsStore
SymSrvIsStoreW
SymSrvStoreFile
SymSrvStoreFileW
SymSrvStoreSupplement
SymSrvStoreSupplementW
UnDecorateSymbolName
UnDecorateSymbolNameW
ldap_get_option
ldap_get_optionW
ldap_set_option
ldap_set_optionW

Affected structs

Windows.Win32.Devices.Tapi.LINEREQMAKECALL
Windows.Win32.Devices.Tapi.LINEREQMAKECALLW
Windows.Win32.Devices.Tapi.LINEREQMEDIACALL
Windows.Win32.Devices.Tapi.LINEREQMEDIACALLW
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_SYMBOL
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_SYMBOLW
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_MODULE
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_MODULEW
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_LINE
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_LINEW
Windows.Win32.System.Diagnostics.Debug.SOURCEFILE
Windows.Win32.System.Diagnostics.Debug.SOURCEFILEW
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_CBA_EVENT
Windows.Win32.System.Diagnostics.Debug.IMAGEHLP_CBA_EVENTW
Windows.Win32.System.Diagnostics.Debug.SRCCODEINFO
Windows.Win32.System.Diagnostics.Debug.SRCCODEINFOW
Windows.Win32.System.Diagnostics.Debug.SYMBOL_INFO
Windows.Win32.System.Diagnostics.Debug.SYMBOL_INFOW
Windows.Win32.System.Diagnostics.Debug.SYMBOL_INFO_PACKAGE
Windows.Win32.System.Diagnostics.Debug.SYMBOL_INFO_PACKAGEW
Windows.Win32.System.Diagnostics.Debug.SYMSRV_INDEX_INFO
Windows.Win32.System.Diagnostics.Debug.SYMSRV_INDEX_INFOW
Windows.Win32.System.Diagnostics.ToolHelp.PROCESSENTRY32
Windows.Win32.System.Diagnostics.ToolHelp.PROCESSENTRY32W
Windows.Win32.System.Diagnostics.ToolHelp.MODULEENTRY32
Windows.Win32.System.Diagnostics.ToolHelp.MODULEENTRY32W
Windows.Win32.System.Mapi.MapiFileDesc
Windows.Win32.System.Mapi.MapiFileDescW
Windows.Win32.System.Mapi.MapiMessage
Windows.Win32.System.Mapi.MapiMessageW
Windows.Win32.System.Mapi.MapiRecipDesc
Windows.Win32.System.Mapi.MapiRecipDescW
Windows.Win32.UI.ColorSystem.EMRCREATECOLORSPACE
Windows.Win32.UI.ColorSystem.EMRCREATECOLORSPACEW

Currently, these attributes seem to be added only to APIs suffixed with A and W:

// Add Ansi or Unicode attributes to -A/-W APIs.
if (name.EndsWith("A") && this.apiNamesToNamespaces.ContainsKey($"{name[0..^1]}W"))
{
var attributeList = SyntaxFactory.AttributeList(
SyntaxFactory.SingletonSeparatedList<AttributeSyntax>(
SyntaxFactory.Attribute(
SyntaxFactory.ParseName("Ansi"))));
node = node.AddAttributeLists(attributeList);
}
else if (name.EndsWith("W") && this.apiNamesToNamespaces.ContainsKey($"{name[0..^1]}A"))
{
var attributeList = SyntaxFactory.AttributeList(
SyntaxFactory.SingletonSeparatedList<AttributeSyntax>(
SyntaxFactory.Attribute(
SyntaxFactory.ParseName("Unicode"))));
node = node.AddAttributeLists(attributeList);
}

However, there are some APIs where the ANSI variants are not suffixed with A, as above.

@halildurmus halildurmus changed the title Some structs are missing Ansi/Unicode attributes Some functions and structs are missing Ansi/Unicode attributes Jan 11, 2024
@mikebattista mikebattista self-assigned this Jan 16, 2024
@mikebattista
Copy link
Contributor

Thanks for the data. Should be able to change the logic to include these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants