Sign in to follow this  
Followers 0
FaridAgl

_GDIPlus_Startup() fails on Windows Server 2008

20 posts in this topic

#1 ·  Posted (edited)

After running the following code on a Windows Server 2008 vps:

#include <GDIPlus.au3>

Global $ret = _GDIPlus_Startup()
Global $err = @error
Global $ext = @extended

MsgBox(0, "", StringFormat("Return:\t%d\nError:\t%d\nExtented:\t%d", $ret, $err, $ext))

 
It always gives the following output, however it worked fine in Windows Server 2003, Windows XP and Windows 7 in all the tests:
 

Return: 0

Error: 1
Extended: 2

 
Any help?

Edited by D4RKON3

Share this post


Link to post
Share on other sites



Well, something is wrong with this part:

If $sGDIPDLL = Default Then
        If @OSBuild > 4999 And @OSBuild < 7600 Then
            ; Vista or Server R2008
            $sGDIPDLL = @WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll"
        Else
            $sGDIPDLL = "gdiplus.dll"
        EndIf
    EndIf

Share this post


Link to post
Share on other sites

Do you have tested it on Windows Server 2008 and/or Windows Server 2008 R2? What is the return value for @OSBuild?

I don't have Win2k8 available right now to make some tests.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

Windows Server 2008 Standard

 

Arch: X86

Build: 6002
Lang: 0409
SPack: Service Pack 2
Type: WIN32_NT
Ver: WIN_2008

Share this post


Link to post
Share on other sites

I have accces to Win2008 R2 Foundation

What exactly to check give me a REPRO.


Wondering who uses AutoIT and what it can be used for ?


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2017-05-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF * GitHub API UDF - modest begining *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@D4RKON3: Can you search for @WindowsDir & "winsxsx86_microsoft.windows.gdiplus_* folder(s) please? Just list them here.

 

@mLipok: Can you test the code from post#1 please and post the results here?

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I make a litle change:

#include <GDIPlus.au3>

Global $ret = _GDIPlus_Startup()
Global $err = @error
Global $ext = @extended

ConsoleWrite(StringFormat("Return:\t%d\nError:\t%d\nExtented:\t%d", $ret, $err, $ext) & @CRLF)

Results:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files (x86)\AutoIt3\SciTE\test.au3" /autoit3dir "C:\Program Files (x86)\AutoIt3" /UserParams    
+>23:13:05 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0409  Keyboard:00000415  OS:WIN_2008R2/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3
+>23:13:06 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Program Files (x86)\AutoIt3\SciTE\test.au3"    
Return: 1
Error:  0
Extented:   0
+>23:13:06 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 1.751

EDIT:

NOTE: AutoIt 3.3.12.0

Edited by mLipok

Wondering who uses AutoIT and what it can be used for ?


ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2017-05-23
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF * GitHub API UDF - modest begining *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

If $sGDIPDLL = Default Then
  If @OSBuild > 4999 And @OSBuild < 7600 Then
   ; Vista or Server R2008
   $sGDIPDLL = @WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll"
 Else
  $sGDIPDLL = "gdiplus.dll"
 EndIf
EndIf

How is it possible that such code find a place in the standard UDF  >_< 

Share this post


Link to post
Share on other sites
If $sGDIPDLL = Default Then
  If @OSBuild > 4999 And @OSBuild < 7600 Then
   ; Vista or Server R2008
   $sGDIPDLL = @WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll"
 Else
  $sGDIPDLL = "gdiplus.dll"
 EndIf
EndIf

How is it possible that such code find a place in the standard UDF  >_<

sometime difficult to follow Windows version ...

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

@WindowsDir & "winsxsx86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744acegdiplus.dll" handles also GDI+ v1.1 functions on Vista and Server 2008 operating systems whereas the default gdiplus.dll cannot on those os'.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites
If $sGDIPDLL = Default Then
  If @OSBuild > 4999 And @OSBuild < 7600 Then
   ; Vista or Server R2008
   $sGDIPDLL = @WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll"
 Else
  $sGDIPDLL = "gdiplus.dll"
 EndIf
EndIf

How is it possible that such code find a place in the standard UDF  >_<

Instead of complaining about it offer a better suggestion, including the workaround UEZ mentioned. 


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Well obviously, It could be done with FileFindFirstFile.

However the right solution is to respect that the OS doesn't want to load it.

Share this post


Link to post
Share on other sites

Considering that the winsxs folder is a backup up folder, amongst other temporary uses, I do not consider it as a good idea to base production code on it especially when Microsoft has released an optional update which allows the option for the "Disk Cleanup Wizard" to remove files from it. A link discusses it here. About "Disk Cleanup Wizard" topic here. The update info is here.

Share this post


Link to post
Share on other sites

The consequences are that GDI+ v1.1 functions (e.g. _GDIPlus_Effect*) are not available for Vista / Server 2008.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

sometime difficult to follow Windows version ...

Nor you should, be reasonable. JFX is completely right, that code should not be part of anything standard. No FileFind or any alternative method sould be supported either.

Function accepts dll path as optional first parameter, that's all. By default it loads gdiplus.dll.

Don't make up things.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

@UEZ, sorry I didn't had access to that vps till now, here you go:

Share this post


Link to post
Share on other sites

from Windows build reference 2008R2 is the same as Win7.

different from Vista/2008

Share this post


Link to post
Share on other sites

@UEZ, sorry I didn't had access to that vps till now, here you go:

attachicon.gif1.png

 

Thanks D4RKON3, meanwhile I had downloaded Server 2008 x64 and tested the issue.

C:\Windows\winsxs>dir *.gdiplus*
 Volume in drive C has no label.
 Volume Serial Number is 1840-42C3

 Directory of C:\Windows\winsxs

01/19/2008  03:11 AM    <DIR>          amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6001.18000_none_56c7f783b549f0ed
04/11/2009  09:12 AM    <DIR>          amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_56a37cbfb59b8501
01/19/2008  03:11 AM    <DIR>          amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6001.18000_none_461966684e4fca94
04/11/2009  09:11 AM    <DIR>          amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6002.18005_none_45f4eba44ea15ea8
01/19/2008  03:11 AM    <DIR>          x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6001.18000_none_9e752e5ac9c619f3
04/11/2009  09:12 AM    <DIR>          x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.6002.18005_none_9e50b396ca17ae07
01/19/2008  03:11 AM    <DIR>          x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6001.18000_none_8dc69d3f62cbf39a
04/11/2009  09:11 AM    <DIR>          x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6002.18005_none_8da2227b631d87ae
               0 File(s)              0 bytes
               8 Dir(s)  16,588,165,120 bytes free

C:\Windows\winsxs>ver

Microsoft Windows [Version 6.0.6002]

The path to the GDI+ v1.1 DLL varies. That means we should remove the section to load GDI+ v1.1 DLL for Vista/Server 2008. The user has the possibility to provide the correct path manually if GDI+ v1.1 is needed.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯

Share this post


Link to post
Share on other sites

You are right, that's the correct way I guess, as trancexx just explained.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0