View Full Version : SysInfo plugin v0.1.2.9
StainlessS
21st June 2019, 12:24
Difference is, Current Process is eg MPC-HC or AvsPMod or VirtualDub or MeGUI, Parent is whatever started current, eg Windows Explorer, or maybe command line [maybe Cmd.Exe, not sure] or whatever.
Parent might be of use on rare occasion.
EDIT: I think parent may sometimes not exist, if has been killed since current process start.
Groucho2004
21st June 2019, 12:31
Until a flash of enlightenment reveals its usefulness to me I think I'll give 'parent process name' a miss.
Groucho2004
21st June 2019, 13:27
v0.1.1.0
- Added 'SI_ProcessName'
StainlessS
21st June 2019, 14:05
Ooo lovely https://www.cosgan.de/images/smilie/liebe/n020.gif
EDIT: nothing wrong with a pat on the head (so long as its not a cow pat).
Groucho2004
22nd July 2019, 10:01
v0.1.1.1
- Updated libcpuid (AMD Zen 2 support)
Groucho2004
26th July 2019, 20:39
v0.1.1.2
- Added SI_GetEnvVar
StainlessS
26th October 2019, 11:43
No hurry, but if updating dll, please add a SysInfo dll version number, just so we know what we got available, will display it in AvsInit thingy.
Thanx muchly
Groucho2004
26th October 2019, 11:50
No hurry, but if updating dll, please add a SysInfo dll version number, just so we know what we got available, will display it in AvsInit thingy.
Thanx muchly
It has a version resource.
StainlessS
26th October 2019, 11:52
Arh, so I gotta write something to extract version from version resource. :) [was wantin' it at runtime, check minimum requirement, likely future mandatory Sysinfo of minimum version]
Groucho2004
26th October 2019, 11:57
Arh, so I gotta write something to extract version from version resource. :) [was wantin' it at runtime, check minimum requirement, likely future mandatory Sysinfo of minimum version]Do you mean to add it to the return value of AvisynthPluginInit? Extracting it from the version resource it easy, have a look at AVSMeter, utility.h, GetFileVersion()/GetProductVersion().
StainlessS
26th October 2019, 11:59
Nope, just return a version number as for eg OS NT version number or avisynth VersionNumber(), as a float, not string.
Groucho2004
26th October 2019, 12:01
Nope, just return a version number as for eg OS NT version number or avisynth VersionNumber(), as a float, not string.0.1.1.2 as float? :confused:
Edit: 0.112 ?
StainlessS
26th October 2019, 12:03
Whatever you decide will suit me fine [edit looks gud].
I use this in RT_Stats, [allows compare version number including beta, RT_Stats version 2.0 beta 12 compares Less Than version 2.0]
#include "compiler.h"
#define VERSION_NUMBER 2.0 // 2 [EDIT: Decimal eg 2.01] Digits of precision
#define VERSION_BETA 12 // writes 2 digits
#define VERSION_DATE "02 Aug 2018"
// ...
AVSValue __cdecl RT_Version(AVSValue args, void* user_data, IScriptEnvironment* env) {
double v = VERSION_NUMBER;
if(VERSION_BETA > 0) {
v = v - 0.001 + (VERSION_BETA / 100000.0);
}
return v;
}
EDIT: And
AVSValue __cdecl RT_VersionString(AVSValue args, void* user_data, IScriptEnvironment* env) {
char bf[64],beta[16];
beta[0]='\0';
if(VERSION_BETA > 0) {
sprintf(beta,"Beta%02d",VERSION_BETA);
}
sprintf(bf,"%.2f%s",VERSION_NUMBER,beta);
return env->SaveString(bf);
}
EDIT: Ideally would get version from version resource, not got around to figuring out how to do that and mangle into my Beta thing yet.
Groucho2004
26th October 2019, 12:04
Whatever you decide will suit me fine [edit looks gud].Ok, no problem.
StainlessS
26th October 2019, 12:28
I've done this now so posting.
v=RT_Version
RT_DebugF("Version=v%s : %f",RT_VersionString,v)
BlankCLip.RT_Subtitle("Version=v%s : %f",RT_VersionString,v)
Result, for RT_stats v2.0 Beta 12
00000171 0.27866700 [3664] RT_DebugF: Version=v2.00Beta12 : 1.999120 # RED '9' digit signifies IS BETA VERSION, with 2 digit beta version number
Groucho2004
27th October 2019, 15:48
v0.1.1.3
- Updated libcpuid
- Added SI_FileVersion
StainlessS
27th October 2019, 18:46
Magic :)
StainlessS
30th October 2019, 22:14
Hi there young master Groucho, hows bout an Avisynth v2.58 version SysInfo Plugin (AvisynthPluginInit2).
Groucho2004
30th October 2019, 23:29
v0.1.1.4
- 32 bit version of the plugin also works with Avisynth 2.5.7 / 2.5.8
StainlessS
31st October 2019, 07:33
Well I never, you dont mess about do you. Thanks muchly.
Groucho2004
31st October 2019, 10:03
Well I neverNothing to write home about, just a couple of conditionals sneaked in.
Groucho2004
2nd February 2020, 13:59
v0.1.1.5
- Updated libcpuid to support AMD Threadripper (Castle Peak)
- Updated AVS+ headers
Groucho2004
21st April 2020, 16:18
@Stainless
Test 00:
SysInfo_0.1.1.6.00.7z (http://www.mediafire.com/file/6xzlkgkwl2c72qy/SysInfo_0.1.1.6.00.7z/file)
This is what I have so far:
AI_IsAvs26
AI_IsAvsNeo
AI_IsAvsPlus
SI_AvailableSystemMemory
SI_CPUExtensions
SI_CPUName
SI_FileVersion
SI_GetEnvVar
SI_HasAVX
SI_HasAVX2
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
SI_HasMMX
SI_HasSSE
SI_HasSSE2
SI_HasSSE3
SI_HasSSE41
SI_HasSSE42
SI_HasSSSE3
SI_IsOS64Bit
SI_IsWin10
SI_IsWin7
SI_IsWin8
SI_IsWin81
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
SI_IsWinVista
SI_IsWinXP
SI_LogicalCores
SI_ModulePath
SI_NumberOfCPUs
SI_OSVersionNumber
SI_OSVersionString
SI_PhysicalCores
SI_ProcessBitness
SI_ProcessName
SI_ScreenBitsPerPixel
SI_ScreenResX
SI_ScreenResY
SI_TotalSystemMemory
StainlessS
21st April 2020, 16:34
Thanx GG,
Below, Copied here from here Real.Finder Avisynth Stuff thread:- https://forum.doom9.org/showthread.php?p=1908588#post1908588
GScriptExists() should also return true if the plugin is present but AVS+ with built-in GScript is used, right?
Where GScript is present under AVS+, so Gscript dll is used as external dll Overrides builtin [also user installed dll for a reason, presumably].
Nope, Script func overrides dll, dll overrides builtin.
Wiki:- http://avisynth.nl/index.php/Plugins#Plugin_Autoload_and_Name_Precedence
EDIT:
Also, where in main script and decision as to use GScript(GSTRING) or Avs+ Eval(GSTRING) to process a GSTRING string containing GScript if/for/next/while type stuff,
scriptor should choose to use GScript(GSTRING) where Gscript dll is available whether Avs std or avs+, and only AVS+ Eval(GSTRING) when Avs+ and no GScript dll installed.
Avs64Bit is already covered with 'SI_ProcessBitness'. Do we need it anyway as a convenience function?
Convenience function, I guess you choose if you wanna do it.
I have SytemEnvironment implemented differently. You pass the environment variable and it returns the value. I think that's more elegant and flexible than having a function for each variable (SystemEnvTemp(), SystemEnvComSpec(), SystemEnvComputerName(), SystemEnvUserName()), don't you think?
Again, Convenience functions, but implement as you will. [maybe a note of possible uses in your copious documentation].
The Operating system and CPU caps would really be useful and a helluva lot easier than extraction from the CPU Caps string.
EDIT:
So above GScriptExists() could be used like this
GSTRING = """
Function SomeFunc(int n) { # AKA Terminal() function, but slow iterated version
sum = 0
for(i=1,n) {
sum = sum + i
}
return sum
}
Function Terminal(int n) { # Fast version of above SomeFunc
# Return sum of integers 1 to n. Input n range 1 to 65535, else returns 0. (From Knuth TAOCP Vol 1)
return (n > 65535 || n <= 0) ? 0 : (n % 2 == 0) ? (n+1)*(n/2) : n * ((n + 1) / 2)
}
"""
GSTR = """
if (Sum == Term) {
S2 = " Sum and Term BOTH SAME"
} else {
S2 = " Sum and Term BOTH DIFFERENT"
}
"""
# Install SomeFunc() and Terminal() as Functions
GScriptExists() ? GScript(GSTRING)
\ : IsAvsPLus() ? Eval(GSTRING)
\ : Assert(False,"Need Either GScript or Avs+ for SomeFunc()")
N=3 # N=3 shows Sum=6
Sum = SomeFunc(N)
Term = Terminal(N)
s = "Sum of Numbers 1 to " + String(N) + " = " + String(Sum) + " : Terminal(" + String(N) + ") = " + String(Term)
# Do something that aint a function : Assign a string to S2 Using GScript style If/Else
GScriptExists() ? GScript(GSTR) : Eval(GSTR) # Already Checked above for either GScript Or AVS+
BlankClip(Width=480,height=128)
Subtitle(s+"\n"+S2,lsp=0)
Return Last
Updated Again
https://i.postimg.cc/761jqFzc/G-00.jpg (https://postimages.org/)
EDIT: NOTE For Pinterf, note the horizontal offset of both strings.
Groucho2004
21st April 2020, 16:37
Thanx GGPlease test it, especially 32 bit AVS.
Groucho2004
21st April 2020, 16:41
Including these might be asking too much (or would it)
Function X_HasAlpha(clip c) { c IsAvsPlus ? HasAlpha : IsRGB32 }
Function X_HasChroma(clip c) { c IsRGB ? False : IsAvsPlus ? !IsY : !IsAvs26||!IsY8 }
Function X_IsYV411(clip c) { c IsAvs26 ? IsYV411 : False }
Function X_IsY(clip c) { c IsAvsPlus ? IsY : IsAvs26 ? IsY8 : False } # True=Single Plane : (!IsRGB)=True = Any type with Y, YUY2/YUVA/Y8 etc. BEWARE Y8_Clip.IsYUV returns True
Function X_Is420(clip c) { c IsAvsPlus ? Is420 : IsYV12 }
Function X_Is422(clip c) { c IsAvsPlus ? Is422 : False } # YUY2_Clip.Is422=False [ie not Planar]
Function X_Is444(clip c) { c IsAvsPlus ? Is444 : IsAvs26 ? IsYV24 : False }
Function X_IsRGB48(clip c) { c IsAvsPlus ? IsRGB48 : False }
Function X_IsRGB64(clip c) { c IsAvsPlus ? IsRGB64 : False }
Function X_IsRGBA(clip c) { c IsRGB && X_HasAlpha }
Function X_NumComponents(clip c) { c IsAvsPlus ? NumComponents : IsAvs26&&IsY8 ? 1 : IsRGB32 ?4 : 3 } # Num of channels
Function X_Bpc(clip c) { c IsAvsPlus ? BitsPerComponent : 8 } # Bits per channel, 32 = Float
Function X_ComponentMax(clip c) { c bpc=X_Bpc Return (bpc==32) ? 1.0 : IsAvsPlus ? BitLShift(1,bpc) - 1 : 255} # Max possible component value for colorspace
Function X_ComponentFullScale(clip c) { c bpc=X_Bpc Return (bpc==32) ? 255/256.0 : IsAvsPlus ? BitLShift(255,bpc-8) : 255} # Bit shifted value for colorspace
Function X_ComponentTvBlack(clip c) { c bpc=X_Bpc Return (bpc==32) ? 16/256.0 : IsAvsPlus ? BitLShift( 16,bpc-8) : 16} # TV Black level for colorspace
Function X_ComponentTvWhite(clip c) { c bpc=X_Bpc Return (bpc==32) ? 235/256.0 : IsAvsPlus ? BitLShift(235,bpc-8) : 235} # TV White level for colorspace
Function X_PixelType(clip c) { c IsAvs26 ? PixelType : IsYV12?"YV12":IsYUY2?"YUY2":IsRGB32?"RGB32":"RGB24" } # Eg "RGB32" or "YUV420P10"
Function X_YMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Height/ExtractU.Height):(IsYV12 ?2:1) } # Y Min crop multiple for Progressive
Function X_XMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Width/ExtractU.Width):IsAvs26?(IsYV411?4:IsYUY2||IsYV16||IsYV12?2:1):(IsRGB?1:2)} # X Min crop multiple
Function X_CsXMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsXMod: CSP Clip or Pixel_Type string ONLY") Return X_XMod }
Function X_CsYMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsYMod: CSP Clip or Pixel_Type string ONLY") Return X_YMod }
EDIT: Not sure those in blue are correct or final [just what I'm using right now].SysInfo doesn't take a clip.
Groucho2004
21st April 2020, 16:45
Now I have to think about all this AVS version number/version string stuff. I would really like to simplify it.
Any suggestions are welcome.
StainlessS
21st April 2020, 16:57
If you like, I could do all of above from post #76, you could take all credit (and blame) :)
EDIT:
SysInfo doesn't take a clip.
Maybe SysInfo eg
XAI_IsY(clip c)
or
XAVS_IsY(clip c)
does.
Groucho2004
21st April 2020, 17:00
If you like, I could do all of above from post #76, you could take all credit (and blame) :)What do you mean by 'I could do all of above'? You already did, did you not?
StainlessS
21st April 2020, 17:05
I mean I could provide the C code.
Also, script snippit from #74 updated.
Groucho2004
21st April 2020, 17:08
I mean I could provide the C code.But SysInfo doesn't accept a clip (and shouldn't). Can you not put that in your RT_Stats plug?
StainlessS
21st April 2020, 17:25
But RT_Stats already can do a lot of that stuff, or maybe with avs script assist, we really need smallish dll that does only
a few (well a lot less than the nearly 200 functions in RT_, currently nearly 500KB dll's, bigger if support HBD)
EDIT: Why should SysInfo not accept a clip for some of its functions.
You want another separate Mandatory dll for cross Avs info.
Another mandatory dll would also need duplicate much functionality that is already in your Sysinfo whatsit, probably making SysInfo obsolete.
Groucho2004
21st April 2020, 17:41
But RT_Stats already can do a lot of that stuff, or maybe with avs script assist, we really need smallish dll that does only
a few (well a lot less than the nearly 200 functions in RT_, currently nearly 500KB dll's, bigger if support HBD)
EDIT: Why should SysInfo not accept a clip for some of its functions.
You want another separate Mandatory dll for cross Avs info.
Another mandatory dll would also need duplicate much functionality that is already in your Sysinfo whatsit, probably making SysInfo obsolete.Ok. I'll look into it. :)
StainlessS
21st April 2020, 18:56
The Isxxx and Hasxxx style whatsits need to return avisynth type Bool, false/true, they are returning type Int 0/1.
return (x != 0); // bool returned as implied AVSValue (function return type is AVSValue)
Groucho2004
21st April 2020, 19:35
The Isxxx and Hasxxx style whatsits need to return avisynth type Bool, false/true, they are returning 0/1.
return (x != 0); // bool returned as implied AVSValue (function return type is AVSValue)
Currently, I'm doing this:
AVSValue SI_HasSSE(AVSValue args, void* user_data, IScriptEnvironment* env)
{
return utils.bHasSSE ? TRUE : FALSE;
}
Do I have to use the lower case variants?
StainlessS
21st April 2020, 19:37
I think that TRUE and FALSE are M$ API type BOOL 1 and 0, ie not [EDIT: CPP] type bool true/false. [EDIT: Changed order to match]
EDIT:
Do I have to use the lower case variants?
yes [returning M$ TRUE or FALSE is really returning avisynth type Int 1 or 0]
return utils.bHasSSE ? true : false;
Groucho2004
21st April 2020, 19:43
I think that TRUE and FALSE are M$ type BOOL 1 and 0, ie not [EDIT: CPP] type bool true/false. [EDIT: Changed order to match]
EDIT:
yes
return utils.bHasSSE ? true : false;
Try this (http://www.mediafire.com/file/okrdybctmylwei9/0.1.1.6.01.7z/file).
StainlessS
21st April 2020, 19:57
Thanks,
IsAvs26() is generally taken to mean NOT v2.58, in script
Function IsAvs26() { VersionNumber>=2.6}
Function IsAvsNeo() { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int } # Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsPlusVersionNumber() { Return PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
Function AvsVersionNumberString() { s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) Return s.LeftStr(s.StrMatchChrLen(ND,True)) }
Function SystemInfoExists() { Return RT_FunctionExist("SI_FileVersion")}
Function GScriptExists() { Return RT_FunctionExist("GScript")}
Function SystemEnvTemp() { Return RT_GetSystemEnv("TEMP")} # Path to USER System environment TEMP folder
Function SystemEnvComSpec() { Return RT_GetSystemEnv("COMSPEC")} # Path to System environment command line processor
# eg "C:\Windows\system32\cmd.exe"
Function SystemEnvComputerName() { Return RT_GetSystemEnv("COMPUTERNAME")} # System environment Commputer Name eg "Colossus"
Function SystemEnvUserName() { Return RT_GetSystemEnv("USERNAME")} # System environment User Name eg "God".
#
Function StrReplace(String s,String fnd,string Rep,bool "sig") { Return RT_StrReplace(s,fnd,Rep,Sig) }
#
Function IsAvs64Bit() { SI_ProcessBitness==64}
Function IsOS64Bit() { Return Findstr(SI_OSVersionString,"x64")!=0}
Function IsWinXP() { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41() { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Return Findstr(SI_CPUExtensions,"AVX2")!=0}
Below should return true on my Avs+
BlankClip
x=AI_IsAvs26
#AI_IsAvsNeo # false OK
#AI_IsAvsPlus # true OK
S=String(x)
Subtitle(s)
Returns False
EDIT: Maybe make sure that something like this:
VersionNumber>=2.6f; // compare with float value rather than double, just incase [I guess dont really matter]
Groucho2004
21st April 2020, 20:27
Oh, I thought IsAvs26() was to identify classic AVS2.6. Will fix tomorrow.
StainlessS
21st April 2020, 20:41
Classic Avs can be by
((IsAvs26) && (!IsAvsPlus))
Will fix tomorrow.
Dont sweat, take your time.
Groucho2004
21st April 2020, 20:51
Classic Avs can be by
((IsAvs26) && (!IsAvsPlus))
That's what it is right now. Well, actually it's
(IsAvs26 && !IsAvsPlus && !IsAvsNeo)
StainlessS
21st April 2020, 21:08
Is now tradition (think by real.Finder EDIT: or maybe me) that IsAvsPlus() is also Neo. [or rather Neo is also AvsPlus]
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0 || IsAvsNeo}
I guess that this could be used
Function IsAvsPlusExclusiveIeNotNeo() { FindStr(VersionString,"AviSynth+")!=0 && (! IsAvsNeo)}
StainlessS
21st April 2020, 21:32
Deleted some rubbish, I got confused again :(
GG, concerning your resource files, Not sure but maybe you have a problem due to missing nul term for strings.
Your SysInfo RC file [Dll Properties Details does not show the Version resource]
#define PRODUCTNAME_STR "SysInfo"
#define VERSION_NUM 0,1,1,5
#define VERSION_STR "0.1.1.5"
#define COPYRIGHT_STR "(c) 2019 - 2020, Groucho2004"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_NUM
PRODUCTVERSION VERSION_NUM
FILEOS VOS_NT
FILETYPE VFT_DLL
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "FileDescription", PRODUCTNAME_STR
VALUE "FileVersion", VERSION_STR
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "ProductName", PRODUCTNAME_STR
VALUE "ProductVersion", VERSION_STR
END
END
END
My Version.h included by Resource.h file, which is inclued by Resource.rc [NOTE NUL TERMS In BLUE ie '\0']
#define Version_Major 0
#define Version_Minor 01 // Two Digits
#define Version_Beta 15 // Two Digits (00 = Not beta)
#define MyPlugName "SysInfo\0"
#define MyVersion_Copyright "(c) 2019 - 2020, Groucho2004\0"
#define MyVersion_Implementor "(c) 2019 - 2020, Groucho2004\0"
// #x Encloses the argument x in quotes.
// #@x Encloses the argument x in single quotes.
// ## Concatenates tokens used as arguments to form other tokens.
#define _STR(x) #x
#define STR(x) _STR(x)
#define MyVersion_Number Version_Major,Version_Minor,Version_Beta,0
#if(Version_Beta > 0)
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) ".Beta" STR(Version_Beta)
#else
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) "." STR(Version_Beta) "." STR(0)
#endif
// Below MUST BE set for avs v2.58 and avs+ x64, Configuration Properties/Resources/General/PreProcessor Definitions
// Avs v2.58, Add definition 'AVISYNTH_PLUGIN_25'
// Avs+ v2.60 x64, Add definition '_WIN64'
#ifdef AVISYNTH_PLUGIN_25
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_25.dll\0"
#define MyDescription "Avisynth v2.58 32 bit CPP Plugin\0"
#else
#ifdef _WIN64
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x64.dll\0"
#define MyDescription "Avisynth+ v2.60 64 bit CPP Plugin\0"
#else
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x86.dll\0"
#define MyDescription "Avisynth+ v2.60 32 bit CPP Plugin\0"
#endif
#endif
NOTE Above, those strings ending eg "_x86.dll" and "_x64.dll" have cpu parts concatenated to the string named before them eg
Where MyPlugName "_x86.dll\0" : and where MyPlugName = "Fred" : So result will be "Fred_x86.dll\0". (Note "Fred" is NOT a nul termed string)
EDIT:
(Note "Fred" is NOT a nul termed string)
Rubbish, Yes it is, in my version.h is "SysInfo\0".
The DATA Strings MUST BE nul termed I think [think I spent a longish time getting it working, probably not optimum, but I aint touching again any time soon].
Also, I only use first 3 part numbers of version, and set last one to 0, eg
#define MyVersion_Number Version_Major,Version_Minor,Version_Beta,0
And just for luck, My Resource.rc [Resource.h just includes Version.h]
#include <windows.h>
#include <commctrl.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include <richedit.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include "resource.h"
//
// Version Information resources
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION MyVersion_Number
PRODUCTVERSION MyVersion_Number
FILEOS VOS_NT
FILETYPE VFT_DLL //VFT_DLL for DLL, VFT_APP for application
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", MyComments
VALUE "FileDescription", MyDescription
VALUE "FileVersion", MyVersion_String
VALUE "LegalCopyright", MyVersion_Copyright
VALUE "OriginalFilename", MyOriginalDllName
VALUE "ProductName", MyPlugName
VALUE "SpecialBuild", MyVersion_Implementor
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
Perhaps adding "\0" at the last moment would work, ie for above first line in last BEGIN block [dont know, dont think I've tried but maybe I should only add the nul at last moment to avoid forgetting them]
VALUE "Comments", MyComments "\0"
EDIT: Above add "\0" at last minute may not work, but I think I'll give it a try just the same.
resource.h [I dont usually even bother to add resource.h to my project]
#ifndef IDC_STATIC
#define IDC_STATIC (-1) // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#endif
#include "Version.h"
EDIT: I dont touch either Resource.h or Resource.rc for different version/plugin, I only mod the Version.h stuff [and even then usually only the first 6 lines].
EDIT: Actually, Avs+ v3.5 r3106 returns VersionNumber=2.60.
Groucho2004
22nd April 2020, 09:24
GG, concerning your resource files, Not sure but maybe you have a problem due to missing nul term for strings.
Your SysInfo RC file [Dll Properties Details does not show the Version resource]Odd, the version resource shows correctly with the version info plugin in my FAR Manager:
https://i.postimg.cc/x8c4s3tP/version.png
Anyway, you're right, there should be a terminating '\0', thanks for pointing it out.
StainlessS
22nd April 2020, 13:36
Oh good, it did work partly.
Not all of my strings show at all for some reason, dont know why, maybe just not enough room in dialog box.
(I think they do show in some other app, maybe FM).
I'm doin a script to compare (where possible) script function with SysInfo output,
should make it easier for testing on multiple OS/Machine.
Uses data whotsit like this.
CMPS="""
# GScriptExists
# SystemInfoExists
# RT_WorkingDir @ SI_ModulePath # Only when in plugins
IsAvs26 @ AI_IsAvs26
IsAvsNeo @ AI_IsAvsNeo
IsAvsPlus @ AI_IsAvsPlus
SystemEnvTemp @ SI_GetEnvVar("TEMP")
SystemEnvComSpec @ SI_GetEnvVar("COMSPEC")
SystemEnvComputerName @ SI_GetEnvVar("COMPUTERNAME")
SystemEnvUserName @ SI_GetEnvVar("USERNAME")
IsAvs64Bit @ SI_ProcessBitness==64
IsOS64Bit @ SI_IsOS64Bit
IsWinXP @ SI_IsWinXP
IsWinVista @ SI_IsWinVista
IsWin7 @ SI_IsWin7
IsWin8 @ SI_IsWin8
IsWin81 @ SI_IsWin81
IsWin10 @ SI_IsWin10
HasMMX @ SI_HasMMX
HasSSE @ SI_HasSSE
HasSSE2 @ SI_HasSSE2
HasSSE3 @ SI_HasSSE3
HasSSE41 @ SI_HasSSE41
HasSSE42 @ SI_HasSSE42
HasAVX @ SI_HasAVX
HasAVX2 @ SI_HasAVX2
RT_GetProcessName(False) @ SI_ProcessName
"""
will show something like this.
00000016 1.68255079 [4736] RT_DebugF: BAD IsAvs26='true'
00000017 1.68259466 [4736] RT_DebugF: AI_IsAvs26='false'
00000018 1.68316853 [4736] RT_DebugF: OK IsAvsNeo='false'
00000019 1.68322110 [4736] RT_DebugF: AI_IsAvsNeo='false'
00000020 1.68378055 [4736] RT_DebugF: OK IsAvsPlus='true'
00000021 1.68383265 [4736] RT_DebugF: AI_IsAvsPlus='true'
00000022 1.68442392 [4736] RT_DebugF: OK SystemEnvTemp='C:\Users\root\AppData\Local\Temp'
00000023 1.68448007 [4736] RT_DebugF: SI_GetEnvVar("TEMP")='C:\Users\root\AppData\Local\Temp'
00000024 1.68504536 [4736] RT_DebugF: OK SystemEnvComSpec='C:\Windows\system32\cmd.exe'
00000025 1.68509829 [4736] RT_DebugF: SI_GetEnvVar("COMSPEC")='C:\Windows\system32\cmd.exe'
00000026 1.68564022 [4736] RT_DebugF: OK SystemEnvComputerName='PLEX-P2'
00000027 1.68569100 [4736] RT_DebugF: SI_GetEnvVar("COMPUTERNAME")='PLEX-P2'
00000028 1.68625510 [4736] RT_DebugF: OK SystemEnvUserName='root'
00000029 1.68631017 [4736] RT_DebugF: SI_GetEnvVar("USERNAME")='root'
00000030 1.68685007 [4736] RT_DebugF: OK IsAvs64Bit='false'
00000031 1.68690181 [4736] RT_DebugF: SI_ProcessBitness==64='false'
00000032 1.68751383 [4736] RT_DebugF: OK IsOS64Bit='true'
00000033 1.68756557 [4736] RT_DebugF: SI_IsOS64Bit='true'
00000034 1.68815219 [4736] RT_DebugF: OK IsWinXP='false'
00000035 1.68820405 [4736] RT_DebugF: SI_IsWinXP='false'
00000036 1.68877614 [4736] RT_DebugF: OK IsWinVista='false'
00000037 1.68882751 [4736] RT_DebugF: SI_IsWinVista='false'
00000038 1.68941772 [4736] RT_DebugF: OK IsWin7='true'
00000039 1.68946850 [4736] RT_DebugF: SI_IsWin7='true'
00000040 1.69006443 [4736] RT_DebugF: OK IsWin8='false'
00000041 1.69011593 [4736] RT_DebugF: SI_IsWin8='false'
00000042 1.69070077 [4736] RT_DebugF: OK IsWin81='false'
00000043 1.69075692 [4736] RT_DebugF: SI_IsWin81='false'
00000044 1.69134343 [4736] RT_DebugF: OK IsWin10='false'
00000045 1.69139457 [4736] RT_DebugF: SI_IsWin10='false'
00000046 1.69208872 [4736] RT_DebugF: OK HasMMX='true'
00000047 1.69214749 [4736] RT_DebugF: SI_HasMMX='true'
00000048 1.69282353 [4736] RT_DebugF: OK HasSSE='true'
00000049 1.69287455 [4736] RT_DebugF: SI_HasSSE='true'
00000050 1.69346738 [4736] RT_DebugF: OK HasSSE2='true'
00000051 1.69351733 [4736] RT_DebugF: SI_HasSSE2='true'
00000052 1.69410539 [4736] RT_DebugF: OK HasSSE3='true'
00000053 1.69415796 [4736] RT_DebugF: SI_HasSSE3='true'
00000054 1.69474018 [4736] RT_DebugF: OK HasSSE41='true'
00000055 1.69479156 [4736] RT_DebugF: SI_HasSSE41='true'
00000056 1.69560206 [4736] RT_DebugF: OK HasSSE42='false'
00000057 1.69566405 [4736] RT_DebugF: SI_HasSSE42='false'
00000058 1.69628870 [4736] RT_DebugF: OK HasAVX='false'
00000059 1.69634235 [4736] RT_DebugF: SI_HasAVX='false'
00000060 1.69693077 [4736] RT_DebugF: OK HasAVX2='false'
00000061 1.69698358 [4736] RT_DebugF: SI_HasAVX2='false'
00000062 1.69960856 [4736] RT_DebugF: BAD RT_GetProcessName(False)='PotPlayerMini.exe'
00000063 1.69966805 [4736] RT_DebugF: SI_ProcessName='C:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe'
Dont worry bout last one, your full Process name probably better. [EDIT I'll fix it so it accepts OK name only node as same as full pathname]
I have yet to synthesize eg AVX512 for test, but Ill get around to it later (got to go to shops, beer gettin low).
Not sure how I will synthesize eg AvailableMemory and some others.
Dont bother with the Funcs requiring clip, I'll do those and supply source, I'm probably a bit more familiar having done in excess of about 50 plugs.
Note, we will require 3 separate dll's, Avs25, x86 and x64 to use appropriate header and binary.
Can you show what the different server OS's
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
show in SI_OSVersionString [and maybe SI_OSVersionNumber].
EDIT: Also these in SI_CPUExtensions [if non obvious]
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
Cheers.
EDIT: Maybe as we get closer I can push a script so that others with more exotic machines (server with some weird instruction set) can test for potential probs.
Groucho2004
22nd April 2020, 14:11
Can you show what the different server OS's
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
show in SI_OSVersionString [and maybe SI_OSVersionNumber].
EDIT: Also these in SI_CPUExtensions [if non obvious]
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
Here (http://www.mediafire.com/file/7v1v8s53vpjcyfs/Utility.7z/file) is the current utility.h file. You should be able to extract above info from the functions CUtils::GetCPUID() and CUtils::GetOSVersion(). Note that the file still needs some re-factoring. :D
Edit - Very busy with 'real' work today, can't work on the plugin.
StainlessS
22nd April 2020, 15:29
Very busy
No sweat, have a nice time at real work :)
EDIT:
Think I'll havta stock-pile some beer for the long months ahead.
Pubs may not be open until XMAS, that may well be one helluva christmas and new year, Prost!
Groucho2004
25th April 2020, 16:26
Is now tradition (think by real.Finder EDIT: or maybe me) that IsAvsPlus() is also Neo. [or rather Neo is also AvsPlus]That logic doesn't sit well with me. I'd rather have a clear distinction between the two and the user can implement further conditionals (if necessary) in the script.
real.finder
25th April 2020, 16:45
That logic doesn't sit well with me. I'd rather have a clear distinction between the two and the user can implement further conditionals (if necessary) in the script.
but isn't neo base on avs+? like avs+ base on avs 2.6
if user want it to work only with neo it can be done simply by using IsAvsNeo so it will not work in other avs
Groucho2004
25th April 2020, 16:50
if user want it to work only with neo it can be done simply by using IsNeoPlus so it will not work in other avsIsNeoPlus == IsAVSNeo. Neo implies "+". What am I missing?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.