Using the FFI Gem in Rpg Maker XP?

So this is probably way more then anyone would expect to do with XP and is job more suited for modern RPG Maker, but I want to consider my options with the project I'm thinking about doing.

FFI (Foreign Function Interface) is something that many languages (including ruby) have, and it allows you to interface with programs or libraries made in compiled languages, such as C/C++. It'd be most helpful for integrating other libraries, either by myself or others, into a game (the most common use case I can think of is integrating ffmpeg, although that would probably be a bit much for XP).

Modern RPG Maker supports this by accident in the form of WebAssembly, and as I just linked, there does exist an FFI system for Ruby, in the form of the "ffi" gem. My question is, is it possible to use this gem with RPG Maker XP? Has anyone tried?
Actually, if you're using the vanilla RMXP game executable, it can run calls to Win32API by default.
That was a default FFI wrapper for Windows DLL's. Even so, it also lets you call other libraries as well if you know what kind of parameters you need to pass to any of those libraries.
Can you show me what that code would look like?
That's hard to answer because some steps are very strict while others are very customizable.
For simplicity's sake, I've picked an example used by zeus81 in the Fullscreen++ script.

Ruby:
GetPrivateProfileString = Win32API.new('kernel32', 'GetPrivateProfileString', 'ppppip', 'i')
buffer = [].pack('x256')
# GetPrivateProfileString.call(section, key, default_value, buffer, buffer.size, filename)
lng = GetPrivateProfileString.call('Fullscreen++', 'Fullscreen', '0', buffer, buffer.size, './Game.ini')
@fullscreen = buffer[0, lng] == '1'

Original thread: https://forums.rpgmakerweb.com/threads/using-the-ffi-gem-in-rpg-maker-xp.166706/