1
0
mirror of https://git.zx2c4.com/wireguard-nt synced 2024-11-11 13:09:25 +00:00
wireguard-nt/api/resource.h
Jason A. Donenfeld 9dba693f78 Introduce WireGuardNT
Co-authored-by: Simon Rozman <simon@rozman.si>
Signed-off-by: Simon Rozman <simon@rozman.si>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02 20:36:36 +02:00

51 lines
1.7 KiB
C

/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved.
*/
#pragma once
#include "wireguard.h"
#include <Windows.h>
/**
* Locates RT_RCDATA resource memory address and size.
*
* @param ResourceName Name of the RT_RCDATA resource. Use MAKEINTRESOURCEW to locate resource by ID.
*
* @param Size Pointer to a variable to receive resource size.
*
* @return Resource address on success. If the function fails, the return value is NULL. To get extended error
* information, call GetLastError.
*/
_Must_inspect_result_
_Return_type_success_(return != NULL)
_Post_maybenull_
_Post_readable_byte_size_(*Size) const VOID *ResourceGetAddress(_In_z_ LPCWSTR ResourceName, _Out_ DWORD *Size);
/**
* Copies resource to a file.
*
* @param DestinationPath File path
*
* @param ResourceName Name of the RT_RCDATA resource. Use MAKEINTRESOURCEW to locate resource by ID.
*
* @return If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To
* get extended error information, call GetLastError.
*/
_Return_type_success_(return != FALSE)
BOOL
ResourceCopyToFile(_In_z_ LPCWSTR DestinationPath, _In_z_ LPCWSTR ResourceName);
/**
* Creates a temporary directory.
*
* @param RandomTempSubDirectory Name of random temporary directory.
*
* @return If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To
* get extended error information, call GetLastError.
*/
_Return_type_success_(return != FALSE)
BOOL
ResourceCreateTemporaryDirectory(_Out_writes_z_(MAX_PATH) LPWSTR RandomTempSubDirectory);