Code of conduct
By participating in this project, you agree to maintain a respectful and collaborative environment. Focus on constructive feedback and helping improve the project for everyone.Getting started
Before contributing:- Fork the repository on GitHub
- Clone your fork locally
- Set up your development environment following the building guide
- Create a new branch for your changes
Code style
WinFsp-MemFs-Extended is written in modern C++ with specific style conventions.Language standards
The project uses C++20 (/std:c++20). You should leverage modern C++ features:
- Smart pointers (
std::unique_ptr,std::shared_ptr) instead of raw pointers - RAII (Resource Acquisition Is Initialization) for resource management
- Move semantics for efficient object transfers
- Standard library containers (
std::vector,std::map, etc.) - Range-based for loops where appropriate
autofor type deduction when it improves readability
Memory safety
Memory safety is critical:- Always use smart pointers for dynamic memory allocation
- Avoid manual
new/deleteoperations - Use RAII patterns to ensure resources are properly released
- Prefer stack allocation over heap allocation when possible
- Use containers like
std::vectorinstead of manual array management
Thread safety
The filesystem must handle concurrent operations safely:- Use appropriate synchronization primitives (mutexes, locks)
- Document which data structures require locking
- Avoid data races and undefined behavior
- Test concurrent operations thoroughly using ConcurrencyStressTester
Naming conventions
Follow the existing naming patterns in the codebase:- Use descriptive names that clearly indicate purpose
- Maintain consistency with surrounding code
- Follow C++ standard library naming conventions
Code organization
The project is organized into focused modules:main.cpp- Entry point and CLI argument parsingmemfs.h/memfs-interface.h- Core filesystem interfacenodes.cpp/nodes.h- File and directory node managementio.cpp- I/O operations (read, write)create.cpp/filecreate.cpp- File creation operationsfileinfo.cpp/dirinfo.cpp- File and directory informationsecurity.cpp- Security and permissionsexceptions.h/exceptions.cpp- Error handling- Additional specialized modules for specific functionality
- Place code in the appropriate module
- Create new modules for substantial new features
- Keep modules focused on a single responsibility
Testing requirements
All contributions must be thoroughly tested before submission.Required testing
You must test your changes with:-
RandomFilesTester - Verify basic file operations work correctly
-
ConcurrencyStressTester - Ensure thread-safety with all procedures
-
Manual testing - Test real-world usage scenarios:
- Copying files to/from the RAM disk
- Running applications from the RAM disk
- Using Windows Explorer and file operations
- Testing edge cases specific to your changes
Testing for bug fixes
If fixing a bug:- Create a test case that reproduces the bug
- Verify the test fails without your fix
- Verify the test passes with your fix
- Run all existing tests to ensure no regressions
Testing for new features
If adding a new feature:- Create comprehensive tests covering normal usage
- Test edge cases and error conditions
- Test interaction with existing features
- Verify performance impact is acceptable
License
WinFsp-MemFs-Extended is licensed under GPL-3.0 (GNU General Public License version 3).What this means for contributors
By submitting a contribution, you agree that:- Your contribution will be licensed under GPL-3.0
- Your contribution is your original work or you have rights to submit it
- You understand that GPL-3.0 is a copyleft license
- Any modifications must also be released under GPL-3.0
GPL-3.0 key points
- Freedom to use: Anyone can use the software for any purpose
- Freedom to study: Source code must remain available
- Freedom to modify: Anyone can modify the software
- Freedom to distribute: Anyone can distribute copies
- Copyleft: Derivative works must also be GPL-3.0
LICENSE file in the repository.
Important licensing notes
- You cannot incorporate this code into proprietary/closed-source software
- Any software that links to or modifies this code must also be GPL-3.0
- If you distribute modified versions, you must provide source code
- You must preserve all copyright and license notices
Pull request process
Follow these steps to submit your contribution:1. Prepare your changes
-
Create a new branch from
mainwith a descriptive name: - Make your changes following the code style guidelines
- Test thoroughly using the testing utilities
-
Commit your changes with clear, descriptive messages:
2. Ensure code quality
Before submitting:- Code compiles without warnings in both Debug and Release configurations
- All tests pass (RandomFilesTester, ConcurrencyStressTester)
- Code follows the project’s style conventions
- Memory leaks have been checked and resolved
- Thread-safety has been verified for concurrent operations
- Documentation has been updated if needed
3. Create the pull request
-
Push your branch to your fork:
- Open a pull request on GitHub
-
Provide a clear description including:
- What changes you made
- Why you made them (what problem does it solve?)
- How you tested the changes
- Any breaking changes or migration notes
- Related issue numbers if applicable
4. Pull request review
Your pull request will be reviewed for:- Code quality and adherence to style guidelines
- Correctness and completeness of the implementation
- Test coverage and verification
- Performance implications
- Compatibility with existing functionality
- Documentation clarity
- Address review comments promptly
- Update your branch with requested changes
- Ask questions if feedback is unclear
- Be open to suggestions and alternative approaches
5. Merging
Once approved:- Your pull request will be merged into the main branch
- Your contribution will be included in the next release
- You’ll be credited as a contributor
Reporting issues
If you find a bug but aren’t ready to fix it yourself:- Check if the issue already exists in the issue tracker
- Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs. actual behavior
- System information (Windows version, WinFsp version)
- Relevant logs or error messages
Getting help
If you need help with development:- Review the existing codebase for examples
- Check the WinFsp documentation for filesystem concepts
- Open an issue to discuss significant changes before implementing
- Ask questions in pull request discussions