--- a/vendor/CMakeLists.adb.txt
+++ b/vendor/CMakeLists.adb.txt
@@ -31,24 +31,38 @@
 	adb/pairing_connection/pairing_connection.cpp
 	adb/services.cpp
 	adb/socket_spec.cpp
-	adb/sysdeps_unix.cpp
 	adb/sysdeps/errno.cpp
-	adb/sysdeps/posix/network.cpp
 	${ADB_APP_PROCESSES_PROTO_SRCS} ${ADB_APP_PROCESSES_PROTO_HDRS}
 	${ADB_HOST_PROTO_SRCS} ${ADB_HOST_PROTO_HDRS}
 	${ADB_KNOWN_HOSTS_PROTO_SRCS} ${ADB_KNOWN_HOSTS_PROTO_HDRS}
 	${ADB_KEY_TYPE_PROTO_SRCS} ${ADB_KEY_TYPE_PROTO_HDRS}
 	${ADB_PAIRING_PROTO_SRCS} ${ADB_PAIRING_PROTO_HDRS})
 
-if(APPLE)
+if(WIN32)
+	list(APPEND libadb_SOURCES
+		adb/client/usb_windows.cpp
+		adb/sysdeps_win32.cpp
+		adb/sysdeps/win32/errno.cpp
+		adb/sysdeps/win32/stat.cpp)
+elseif(APPLE)
 	list(APPEND libadb_SOURCES
-		adb/client/usb_osx.cpp)
+		adb/client/usb_osx.cpp
+		adb/sysdeps_unix.cpp
+		adb/sysdeps/posix/network.cpp)
 else()
 	list(APPEND libadb_SOURCES
-		adb/client/usb_linux.cpp)
+		adb/client/usb_linux.cpp
+		adb/sysdeps_unix.cpp
+		adb/sysdeps/posix/network.cpp)
 endif()
 
 add_library(libadb STATIC ${libadb_SOURCES})
+if(WIN32)
+	target_compile_definitions(libadb PRIVATE
+		UNICODE _UNICODE _POSIX _POSIX_SOURCE)
+target_include_directories(libadb PUBLIC
+		development/host/windows/usb/api)
+endif()
 target_compile_definitions(libadb PRIVATE -D_GNU_SOURCE)
 target_compile_definitions(libadb PUBLIC -DADB_HOST=1)
 target_include_directories(libadb PUBLIC
@@ -98,6 +112,9 @@
 
 target_compile_definitions(liblog PRIVATE
 	-DLIBLOG_LOG_TAG=1006 -D_XOPEN_SOURCE=700 -DFAKE_LOG_DEVICE=1)
+if(WIN32)
+	target_compile_definitions(liblog PRIVATE WIN32_LEAN_AND_MEAN)
+endif()
 target_include_directories(liblog PUBLIC
 	core/include
 	logging/liblog/include
@@ -105,26 +122,35 @@
 	libbase/include)
 
 set(libcutils_SOURCES
-	core/libcutils/android_get_control_file.cpp
-	core/libcutils/ashmem-host.cpp
 	core/libcutils/config_utils.cpp
-	core/libcutils/fs.cpp
-	core/libcutils/hashmap.cpp
 	core/libcutils/iosched_policy.cpp
 	core/libcutils/load_file.cpp
-	core/libcutils/multiuser.cpp
 	core/libcutils/native_handle.cpp
 	core/libcutils/properties.cpp
 	core/libcutils/record_stream.cpp
-	core/libcutils/socket_inaddr_any_server_unix.cpp
-	core/libcutils/socket_local_client_unix.cpp
-	core/libcutils/socket_local_server_unix.cpp
-	core/libcutils/socket_network_client_unix.cpp
-	core/libcutils/sockets_unix.cpp
 	core/libcutils/sockets.cpp
-	core/libcutils/str_parms.cpp
-	core/libcutils/strlcpy.c
-	core/libcutils/trace-host.cpp)
+	core/libcutils/strlcpy.c)
+
+if (WIN32)
+	list(APPEND libcutils_SOURCES
+		core/libcutils/socket_inaddr_any_server_windows.cpp
+		core/libcutils/socket_network_client_windows.cpp
+		core/libcutils/sockets_windows.cpp)
+else()
+	list(APPEND libcutils_SOURCES
+		core/libcutils/android_get_control_file.cpp
+		core/libcutils/ashmem-host.cpp
+		core/libcutils/fs.cpp
+		core/libcutils/hashmap.cpp
+		core/libcutils/multiuser.cpp
+		core/libcutils/socket_inaddr_any_server_unix.cpp
+		core/libcutils/socket_local_client_unix.cpp
+		core/libcutils/socket_local_server_unix.cpp
+		core/libcutils/socket_network_client_unix.cpp
+		core/libcutils/sockets_unix.cpp
+		core/libcutils/str_parms.cpp
+		core/libcutils/trace-host.cpp)
+endif()
 
 if (NOT APPLE AND NOT WIN32)
 	list(APPEND libcutils_SOURCES
@@ -159,7 +185,7 @@
 target_include_directories(libcrypto PUBLIC
 	core/libcrypto_utils/include boringssl/include)
 
-add_executable(adb
+set(adb_SOURCES
 	  adb/adb.cpp
 	  adb/adb_io.cpp
 	  adb/adb_listeners.cpp
@@ -168,7 +194,6 @@
 	  adb/adb_utils.cpp
 	  adb/fdevent/fdevent.cpp
 	  adb/fdevent/fdevent_poll.cpp
-	  adb/fdevent/fdevent_epoll.cpp
 	  adb/shell_service_protocol.cpp
 	  adb/sockets.cpp
 	  adb/socket_spec.cpp
@@ -179,6 +204,18 @@
 	  adb/types.cpp
 	  ${ADB_KEY_TYPE_PROTO_HDRS})
 
+if(WIN32)
+	list(APPEND adb_SOURCES
+		)
+else()
+	list(APPEND adb_SOURCES
+		adb/fdevent/fdevent_epoll.cpp)
+endif()
+
+add_executable(adb ${adb_SOURCES})
+if(WIN32)
+	target_compile_definitions(adb PRIVATE _GNU_SOURCE _POSIX _POSIX_SOURCE)
+endif()
 target_include_directories(adb PRIVATE
 	core/include libbase/include adb
 	core/libcrypto_utils/include boringssl/include)
@@ -204,6 +241,11 @@
 	PkgConfig::libusb-1.0
 	z
 	PkgConfig::libzstd)
+if(WIN32)
+	add_dependencies(adb AdbWinApi)
+	target_link_libraries(adb "${ADBWINAPI_LIBRARY}" ws2_32)
+	set_target_properties(adb PROPERTIES LINK_FLAGS "-municode")
+endif()
 
 if(APPLE)
 	target_link_libraries(adb
--- a/vendor/CMakeLists.fastboot.txt
+++ b/vendor/CMakeLists.fastboot.txt
@@ -14,17 +14,7 @@
 	libbase/include)
 
 add_library(libutil STATIC
-	core/libutils/FileMap.cpp
-	core/libutils/JenkinsHash.cpp
-	core/libutils/LightRefBase.cpp
-	core/libutils/NativeHandle.cpp
-	core/libutils/Printer.cpp
-	core/libutils/StopWatch.cpp
-	core/libutils/SystemClock.cpp
-	core/libutils/Threads.cpp
-	core/libutils/Timers.cpp
-	core/libutils/Tokenizer.cpp
-	core/libutils/misc.cpp)
+	core/libutils/FileMap.cpp)
 
 target_include_directories(libutil PUBLIC
 	core/include
@@ -43,6 +33,7 @@
 
 # Only add common sources from libselinux_defaults and libselinux
 # See the file list in selinux/libselinux/Android.bp
+if(NOT WIN32)
 add_library(libselinux STATIC
 	selinux/libselinux/src/booleans.c
 	selinux/libselinux/src/callbacks.c
@@ -99,6 +90,7 @@
 
 target_include_directories(libsepol PUBLIC
 	selinux/libsepol/include)
+endif(NOT WIN32)
 
 set(fastboot_SOURCES
 	core/fastboot/bootimg_utils.cpp
@@ -116,7 +108,10 @@
 	core/fastboot/vendor_boot_img_utils.cpp
 	core/fastboot/util.cpp)
 
-if(APPLE)
+if(WIN32)
+	list(APPEND fastboot_SOURCES
+		core/fastboot/usb_windows.cpp)
+elseif(APPLE)
 	list(APPEND fastboot_SOURCES
 		core/fastboot/usb_osx.cpp)
 else()
@@ -130,13 +125,24 @@
 	extras/ext4_utils/include extras/f2fs_utils
 	core/libziparchive/include mkbootimg/include/bootimg
 	core/fs_mgr/liblp/include core/fs_mgr/libstorage_literals avb)
+if(WIN32)
+	target_compile_definitions(fastboot PRIVATE WIN32_LEAN_AND_MEAN)
+	target_include_directories(fastboot PRIVATE development/host/windows/usb/api)
+endif()
 target_compile_definitions(fastboot PRIVATE
 	-D_GNU_SOURCE -D_XOPEN_SOURCE=700 -DUSE_F2FS
 	-DANDROID_MKE2FS_NAME="${ANDROID_MKE2FS_NAME}")
 target_link_libraries(fastboot
 	libsparse libzip libcutils liblog liblp libutil
-	libbase libext4 libselinux libsepol libdiagnoseusb crypto
-	z PkgConfig::libpcre2-8 Threads::Threads dl)
+	libbase libext4 libdiagnoseusb crypto
+	z PkgConfig::libpcre2-8 Threads::Threads)
+if(WIN32)
+	add_dependencies(fastboot AdbWinApi)
+	target_link_libraries(fastboot "${ADBWINAPI_LIBRARY}")
+else()
+	target_link_libraries(fastboot
+		libselinux libsepol dl)
+endif()
 
 if(APPLE)
 	target_link_libraries(fastboot
--- a/vendor/CMakeLists.libbase.txt
+++ b/vendor/CMakeLists.libbase.txt
@@ -1,7 +1,6 @@
-add_library(libbase STATIC
-	libbase/abi_compatibility.cpp
+set(libbase_SOURCES
+    libbase/abi_compatibility.cpp
     libbase/chrono_utils.cpp
-    libbase/cmsg.cpp
     libbase/file.cpp
     libbase/hex.cpp
     libbase/logging.cpp
@@ -14,9 +13,22 @@
     libbase/stringprintf.cpp
     libbase/strings.cpp
     libbase/threads.cpp
-    libbase/test_utils.cpp
-    libbase/errors_unix.cpp)
+    libbase/test_utils.cpp)
 
+if(WIN32)
+    list(APPEND libbase_SOURCES
+        libbase/errors_windows.cpp
+        libbase/utf8.cpp)
+else()
+    list(APPEND libbase_SOURCES
+        libbase/cmsg.cpp
+        libbase/errors_unix.cpp)
+endif()
+
+add_library(libbase STATIC ${libbase_SOURCES})
+if(WIN32)
+	target_compile_definitions(libbase PUBLIC _POSIX_C_SOURCE)
+endif()
 target_include_directories(libbase PUBLIC
 	libbase/include core/include)
 target_link_libraries(libbase PUBLIC fmt::fmt liblog)
--- a/vendor/CMakeLists.mkbootimg.txt
+++ b/vendor/CMakeLists.mkbootimg.txt
@@ -1,7 +1,7 @@
 set(MKBOOTIMG_SCRIPTS_DIR ${CMAKE_INSTALL_DATADIR}/android-tools/mkbootimg)
 install(PROGRAMS mkbootimg/mkbootimg.py DESTINATION ${MKBOOTIMG_SCRIPTS_DIR})
-add_custom_target(mkbootimg_symlink ALL COMMAND ${CMAKE_COMMAND} -E create_symlink
-	../${MKBOOTIMG_SCRIPTS_DIR}/mkbootimg.py
+add_custom_target(mkbootimg_symlink ALL COMMAND ${CMAKE_COMMAND} -E copy
+	${CMAKE_CURRENT_SOURCE_DIR}/mkbootimg/mkbootimg.py
 	${CMAKE_CURRENT_BINARY_DIR}/mkbootimg)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mkbootimg DESTINATION ${CMAKE_INSTALL_BINDIR})
 install(FILES mkbootimg/gki/generate_gki_certificate.py DESTINATION ${MKBOOTIMG_SCRIPTS_DIR}/gki)
--- a/vendor/CMakeLists.partition.txt
+++ b/vendor/CMakeLists.partition.txt
@@ -15,6 +15,7 @@
 target_include_directories(liblp PUBLIC
 	core/fs_mgr/liblp/include)
 
+if(NOT WIN32)
 protobuf_generate_cpp(DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_SRCS DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_HDRS
 	extras/partition_tools/dynamic_partitions_device_info.proto)
 
@@ -54,3 +55,4 @@
 	extras/partition_tools/lpunpack.cc)
 target_link_libraries(lpunpack
 	libbase liblog liblp libsparse)
+endif(NOT WIN32)
--- a/vendor/CMakeLists.sparse.txt
+++ b/vendor/CMakeLists.sparse.txt
@@ -24,3 +24,6 @@
 	core/libsparse/append2simg.cpp)
 target_link_libraries(append2simg
 	libsparse z libbase)
+if(WIN32)
+	target_compile_definitions(append2simg PRIVATE _GNU_SOURCE)
+endif()
--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -91,7 +91,7 @@
 
 find_package(Protobuf CONFIG)
 find_package(Protobuf REQUIRED)
-set(THREADS_PREFER_PTHREAD_FLAG ON)
+#set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
 
 check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
@@ -110,24 +110,39 @@
 include_directories(${PROTOBUF_INCLUDE_DIRS})
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
+if(WIN32)
+	set(ADBWINAPI_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/AdbWinApi.dll.a")
+	add_custom_command(
+		OUTPUT "${ADBWINAPI_LIBRARY}"
+		COMMAND dlltool -d "${CMAKE_CURRENT_SOURCE_DIR}/AdbWinApi.def" -l "${ADBWINAPI_LIBRARY}"
+		DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/AdbWinApi.def")
+	add_custom_target(AdbWinApi DEPENDS "${ADBWINAPI_LIBRARY}")
+endif(WIN32)
+
 include(CMakeLists.libbase.txt)
 include(CMakeLists.adb.txt)
 include(CMakeLists.sparse.txt)
 include(CMakeLists.fastboot.txt)
-include(CMakeLists.f2fstools.txt)
-include(CMakeLists.mke2fs.txt)
 include(CMakeLists.partition.txt)
 include(CMakeLists.mkbootimg.txt)
 include(CMakeLists.libufdt.txt)
 include(CMakeLists.avb.txt)
+if(NOT WIN32)
+	include(CMakeLists.f2fstools.txt)
+	include(CMakeLists.mke2fs.txt)
+endif()
 
 # Targets which should be installed by `make install`.
 install(TARGETS
-	"${ANDROID_MKE2FS_NAME}"
 	adb
 	append2simg
 	fastboot
 	img2simg
+	simg2img
+	DESTINATION bin)
+if(NOT WIN32)
+install(TARGETS
+	"${ANDROID_MKE2FS_NAME}"
 	lpadd
 	lpdump
 	lpflash
@@ -135,11 +150,11 @@
 	lpunpack
 	make_f2fs
 	sload_f2fs
-	simg2img
 	ext2simg
 	DESTINATION bin)
+endif()
 
-if(NOT APPLE)
+if(NOT APPLE AND NOT WIN32)
 	install(TARGETS
 		e2fsdroid
 		DESTINATION bin)
