Skip to content

Commit

Permalink
Port zinject to Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed May 19, 2024
1 parent bd9f8b4 commit 81e0596
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ add_subdirectory(zstream)
add_subdirectory(os/windows/kstat)
add_subdirectory(os/windows/zfsinstaller)
add_subdirectory(raidz_test)
add_subdirectory(zinject)
22 changes: 22 additions & 0 deletions cmd/zinject/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

use_clang()

um_add_executable(zinject
zinject.c
translate.c
os/windows/resource.rc
)

target_link_libraries(zinject PRIVATE
libnvpair
libuutil
libuuid
libzfs
libzfs_core
libzpool
)
install(TARGETS zinject RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES $<TARGET_PDB_FILE:zinject>
DESTINATION "${CMAKE_INSTALL_BINDIR}"
OPTIONAL
)
15 changes: 15 additions & 0 deletions cmd/zinject/os/windows/resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// {{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by resource.rc
//

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
110 changes: 110 additions & 0 deletions cmd/zinject/os/windows/resource.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Microsoft Visual C++ generated resource script.
//
#include <windows.h>
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (India) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENN)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_INDIA
#pragma code_page(1252)

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "400904b0"
BEGIN
VALUE "CompanyName", "TODO: <Company name>"
VALUE "FileDescription", "zinject.exe"
VALUE "FileVersion", "1.0.0.1"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "resource.rc"
VALUE "ProductName", "zinject.exe"
VALUE "ProductVersion", "1.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x4009, 1200
END
END

#endif // English (India) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

1 change: 0 additions & 1 deletion cmd/zinject/zinject.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>

#include <sys/fs/zfs.h>
Expand Down

0 comments on commit 81e0596

Please sign in to comment.