CommandLineToArgv function shell32

Win32Result<Pointer<Pointer<Utf16>>> CommandLineToArgv(
  1. PCWSTR lpCmdLine,
  2. Pointer<Int32> pNumArgs
)

Parses a Unicode command line string and returns an array of pointers to the command line arguments, along with a count of such arguments, in a way that is similar to the standard C run-time argv and argc values.

To learn more, see learn.microsoft.com/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw.

Implementation

Win32Result<Pointer<Pointer<Utf16>>> CommandLineToArgv(
  PCWSTR lpCmdLine,
  Pointer<Int32> pNumArgs,
) {
  final result_ = CommandLineToArgvW_Wrapper(lpCmdLine, pNumArgs);
  return Win32Result(value: result_.value.ptr.cast(), error: result_.error);
}