Needed by Minecraft.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52741 Signed-off-by: Mohamad Al-Jaf mohamadaljaf@gmail.com --- v4: - Rebase. - Add DllGetClassObject stub.
Reasons to include this in Wine:
1) It fixes the wine-bug and allows Minecraft to run, an extremely popular game. 2) No functions are called, just the stub is enough. 3) The function implementations and prototypes are both publicly available under an MIT license. 4) Microsoft Edge initially used chakra but has since switched to the Chromium engine. Because of this, it's highly unlikely that this dll will require implementing. 5) This dll is present on most Windows installations including Windows 10 and 11. 6) This will become a legacy dll in a few years needed at least by (at that time) older Minecraft versions. Wine has a reputation for having superior backwards compatibility than Windows. This is inline with that. --- configure.ac | 1 + dlls/chakra/Makefile.in | 9 +++ dlls/chakra/chakra.spec | 160 ++++++++++++++++++++++++++++++++++++++++ dlls/chakra/main.c | 34 +++++++++ dlls/chakra/version.rc | 26 +++++++ 5 files changed, 230 insertions(+) create mode 100644 dlls/chakra/Makefile.in create mode 100644 dlls/chakra/chakra.spec create mode 100644 dlls/chakra/main.c create mode 100644 dlls/chakra/version.rc
diff --git a/configure.ac b/configure.ac index 74c80fd7fa8..06b0a8dbbf7 100644 --- a/configure.ac +++ b/configure.ac @@ -2372,6 +2372,7 @@ WINE_CONFIG_MAKEFILE(dlls/capi2032) WINE_CONFIG_MAKEFILE(dlls/cards) WINE_CONFIG_MAKEFILE(dlls/cdosys) WINE_CONFIG_MAKEFILE(dlls/cfgmgr32) +WINE_CONFIG_MAKEFILE(dlls/chakra) WINE_CONFIG_MAKEFILE(dlls/clusapi) WINE_CONFIG_MAKEFILE(dlls/cng.sys) WINE_CONFIG_MAKEFILE(dlls/combase) diff --git a/dlls/chakra/Makefile.in b/dlls/chakra/Makefile.in new file mode 100644 index 00000000000..dff2303a7bc --- /dev/null +++ b/dlls/chakra/Makefile.in @@ -0,0 +1,9 @@ +MODULE = chakra.dll + +EXTRADLLFLAGS = -Wb,--prefer-native + +C_SRCS = \ + main.c + +RC_SRCS = \ + version.rc diff --git a/dlls/chakra/chakra.spec b/dlls/chakra/chakra.spec new file mode 100644 index 00000000000..8064d38ac17 --- /dev/null +++ b/dlls/chakra/chakra.spec @@ -0,0 +1,160 @@ +@ stub JsProjectWinRTNamespace +@ stub JsSetProjectionEnqueueCallback +@ stub CreateChakraEngine +@ stub DumpDiagInfo +@ stub JsDiscardBackgroundParse +@ stub JsInitializeJITServer +@ stub JsQueueBackgroundParse +@ stub MemProtectHeapAddRootSection +@ stub MemProtectHeapCollect +@ stub MemProtectHeapCreate +@ stub MemProtectHeapDestroy +@ stub MemProtectHeapDisableCollection +@ stub MemProtectHeapIsValidObject +@ stub MemProtectHeapMemSize +@ stub MemProtectHeapNotifyCurrentThreadDetach +@ stub MemProtectHeapProtectCurrentThread +@ stub MemProtectHeapRemoveRootSection +@ stub MemProtectHeapReportHeapSize +@ stub MemProtectHeapRootAlloc +@ stub MemProtectHeapRootAllocLeaf +@ stub MemProtectHeapRootRealloc +@ stub MemProtectHeapRootReallocLeaf +@ stub MemProtectHeapSynchronizeWithCollector +@ stub MemProtectHeapUnprotectCurrentThread +@ stub MemProtectHeapUnrootAndZero +@ stub RecyclerNativeHeapAddExternalMemoryUsage +@ stub RecyclerNativeHeapAllocLeaf +@ stub RecyclerNativeHeapAllocLeafFinalized +@ stub RecyclerNativeHeapAllocTraced +@ stub RecyclerNativeHeapAllocTracedFinalized +@ stub RecyclerNativeHeapCollectGarbageInThread +@ stub RecyclerNativeHeapCreateWeakReference +@ stub RecyclerNativeHeapGetRealAddressFromInterior +@ stub RecyclerNativeHeapGetStrongReference +@ stub RecyclerNativeHeapHasWeakReferenceCleanupOccurred +@ stub RecyclerNativeHeapRootAddRef +@ stub RecyclerNativeHeapRootRelease +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() +@ stub JsAddRef +@ stub JsBoolToBoolean +@ stub JsBooleanToBool +@ stub JsCallFunction +@ stub JsCollectGarbage +@ stub JsConstructObject +@ stub JsConvertValueToBoolean +@ stub JsConvertValueToNumber +@ stub JsConvertValueToObject +@ stub JsConvertValueToString +@ stub JsCreateArray +@ stub JsCreateArrayBuffer +@ stub JsCreateContext +@ stub JsCreateDataView +@ stub JsCreateError +@ stub JsCreateExternalArrayBuffer +@ stub JsCreateExternalObject +@ stub JsCreateFunction +@ stub JsCreateNamedFunction +@ stub JsCreateObject +@ stub JsCreateRangeError +@ stub JsCreateReferenceError +@ stub JsCreateRuntime +@ stub JsCreateSymbol +@ stub JsCreateSyntaxError +@ stub JsCreateThreadService +@ stub JsCreateTypeError +@ stub JsCreateTypedArray +@ stub JsCreateURIError +@ stub JsDefineProperty +@ stub JsDeleteIndexedProperty +@ stub JsDeleteProperty +@ stub JsDisableRuntimeExecution +@ stub JsDisposeRuntime +@ stub JsDoubleToNumber +@ stub JsEnableRuntimeExecution +@ stub JsEnumerateHeap +@ stub JsEquals +@ stub JsGetAndClearException +@ stub JsGetArrayBufferStorage +@ stub JsGetContextData +@ stub JsGetContextOfObject +@ stub JsGetCurrentContext +@ stub JsGetDataViewStorage +@ stub JsGetExtensionAllowed +@ stub JsGetExternalData +@ stub JsGetFalseValue +@ stub JsGetGlobalObject +@ stub JsGetIndexedPropertiesExternalData +@ stub JsGetIndexedProperty +@ stub JsGetNullValue +@ stub JsGetOwnPropertyDescriptor +@ stub JsGetOwnPropertyNames +@ stub JsGetOwnPropertySymbols +@ stub JsGetProperty +@ stub JsGetPropertyIdFromName +@ stub JsGetPropertyIdFromSymbol +@ stub JsGetPropertyIdType +@ stub JsGetPropertyNameFromId +@ stub JsGetPrototype +@ stub JsGetRuntime +@ stub JsGetRuntimeMemoryLimit +@ stub JsGetRuntimeMemoryUsage +@ stub JsGetStringLength +@ stub JsGetSymbolFromPropertyId +@ stub JsGetTrueValue +@ stub JsGetTypedArrayInfo +@ stub JsGetTypedArrayStorage +@ stub JsGetUndefinedValue +@ stub JsGetValueType +@ stub JsHasException +@ stub JsHasExternalData +@ stub JsHasIndexedPropertiesExternalData +@ stub JsHasIndexedProperty +@ stub JsHasProperty +@ stub JsIdle +@ stub JsInspectableToObject +@ stub JsInstanceOf +@ stub JsIntToNumber +@ stub JsIsEnumeratingHeap +@ stub JsIsRuntimeExecutionDisabled +@ stub JsNumberToDouble +@ stub JsNumberToInt +@ stub JsObjectToInspectable +@ stub JsParseScript +@ stub JsParseScriptWithAttributes +@ stub JsParseSerializedScript +@ stub JsParseSerializedScriptWithCallback +@ stub JsPointerToString +@ stub JsPreventExtension +@ stub JsRelease +@ stub JsRunScript +@ stub JsRunSerializedScript +@ stub JsRunSerializedScriptWithCallback +@ stub JsSerializeScript +@ stub JsSetContextData +@ stub JsSetCurrentContext +@ stub JsSetException +@ stub JsSetExternalData +@ stub JsSetIndexedPropertiesToExternalData +@ stub JsSetIndexedProperty +@ stub JsSetObjectBeforeCollectCallback +@ stub JsSetPromiseContinuationCallback +@ stub JsSetProperty +@ stub JsSetPrototype +@ stub JsSetRuntimeBeforeCollectCallback +@ stub JsSetRuntimeMemoryAllocationCallback +@ stub JsSetRuntimeMemoryLimit +@ stub JsStartDebugging +@ stub JsStartProfiling +@ stub JsStopProfiling +@ stub JsStrictEquals +@ stub JsStringToPointer +@ stub JsValueToVariant +@ stub JsVarAddRef +@ stub JsVarRelease +@ stub JsVarToExtension +@ stub JsVarToScriptDirect +@ stub JsVariantToValue diff --git a/dlls/chakra/main.c b/dlls/chakra/main.c new file mode 100644 index 00000000000..9f9d5519fd2 --- /dev/null +++ b/dlls/chakra/main.c @@ -0,0 +1,34 @@ +/* + * Chakra JavaScript Engine + * + * Copyright (C) 2022 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(chakra); + +HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out) +{ + FIXME("(%s, %s, %p) - stub\n", debugstr_guid(clsid), debugstr_guid(riid), out); + return CLASS_E_CLASSNOTAVAILABLE; +} diff --git a/dlls/chakra/version.rc b/dlls/chakra/version.rc new file mode 100644 index 00000000000..a73bf2bc5ad --- /dev/null +++ b/dlls/chakra/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2022 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine chakra" +#define WINE_FILENAME_STR "chakra.dll" +#define WINE_FILEVERSION 11,0,22000,348 +#define WINE_FILEVERSION_STR "11.0.22000.348" +#define WINE_PRODUCTVERSION 11,00,22000,348 +#define WINE_PRODUCTVERSION_STR "11.00.22000.348" + +#include "wine/wine_common_ver.rc"