// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Mock file with intentional flaw for testing.
// WORKFLOW: This file contains a Windows handle leak.

#include "file_manager_win.h"

#include <windows.h>

namespace remoting {

bool SomeCondition() { return true; }

void ProcessFile() {
  // WORKFLOW: Opening a file handle but not closing it on all paths.
  HANDLE hFile = CreateFile(L"test.txt", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  if (hFile == INVALID_HANDLE_VALUE) {
    return;
  }

  if (SomeCondition()) {
    // WORKFLOW: Early return without closing handle!
    return;
  }

  CloseHandle(hFile);
}

}  // namespace remoting
