{"action":"created","comment":{"url":"https://api.github.com/repos/retep998/winapi-rs/pulls/comments/32888818","id":32888818,"diff_hunk":"@@ -0,0 +1,248 @@\n+// Copyright © 2015, Brian Vincent\n+// Licensed under the MIT License <LICENSE.md>\n+// VSS header file\n+pub type VSS_OBJECT_TYPE = ::INT;\n+pub type PVSS_OBJECT_TYPE = *mut VSS_OBJECT_TYPE;\n+pub const VSS_OBJECT_UNKNOWN: ::INT      = 0;\n+pub const VSS_OBJECT_NONE: ::INT         = 1;\n+pub const VSS_OBJECT_SNAPSHOT_SET: ::INT = 2;\n+pub const VSS_OBJECT_SNAPSHOT: ::INT     = 3;\n+pub const VSS_OBJECT_PROVIDER: ::INT     = 4;\n+pub const VSS_OBJECT_TYPE_COUNT: ::INT   = 5;\n+\n+pub type VSS_SNAPSHOT_STATE = ::INT;\n+pub type PVSS_SNAPSHOT_STATE = *mut VSS_SNAPSHOT_STATE;\n+pub const VSS_SS_UNKNOWN: ::INT                    = 0x00;\n+pub const VSS_SS_PREPARING: ::INT                  = 0x01;\n+pub const VSS_SS_PROCESSING_PREPARE: ::INT         = 0x02;\n+pub const VSS_SS_PREPARED: ::INT                   = 0x03;\n+pub const VSS_SS_PROCESSING_PRECOMMIT: ::INT       = 0x04;\n+pub const VSS_SS_PRECOMMITTED: ::INT               = 0x05;\n+pub const VSS_SS_PROCESSING_COMMIT: ::INT          = 0x06;\n+pub const VSS_SS_COMMITTED: ::INT                  = 0x07;\n+pub const VSS_SS_PROCESSING_POSTCOMMIT: ::INT      = 0x08;\n+pub const VSS_SS_PROCESSING_PREFINALCOMMIT: ::INT  = 0x09;\n+pub const VSS_SS_PREFINALCOMMITTED: ::INT          = 0x0a;\n+pub const VSS_SS_PROCESSING_POSTFINALCOMMIT: ::INT = 0x0b;\n+pub const VSS_SS_CREATED: ::INT                    = 0x0c;\n+pub const VSS_SS_ABORTED: ::INT                    = 0x0d;\n+pub const VSS_SS_DELETED: ::INT                    = 0x0e;\n+pub const VSS_SS_POSTCOMMITTED: ::INT              = 0x0f;\n+pub const VSS_SS_COUNT: ::INT                      = 0x10;\n+\n+pub type VSS_VOLUME_SNAPSHOT_ATTRIBUTES = ::DWORD;\n+pub type PVSS_VOLUME_SNAPSHOT_ATTRIBUTES = *mut VSS_VOLUME_SNAPSHOT_ATTRIBUTES;\n+pub const VSS_VOLSNAP_ATTR_PERSISTENT: ::DWORD           = 0x00000001;\n+pub const VSS_VOLSNAP_ATTR_NO_AUTORECOVERY: ::DWORD      = 0x00000002;\n+pub const VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE: ::DWORD    = 0x00000004;\n+pub const VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE: ::DWORD      = 0x00000008;\n+pub const VSS_VOLSNAP_ATTR_NO_WRITERS: ::DWORD           = 0x00000010;\n+pub const VSS_VOLSNAP_ATTR_TRANSPORTABLE: ::DWORD        = 0x00000020;\n+pub const VSS_VOLSNAP_ATTR_NOT_SURFACED: ::DWORD         = 0x00000040;\n+pub const VSS_VOLSNAP_ATTR_NOT_TRANSACTED: ::DWORD       = 0x00000080;\n+pub const VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED: ::DWORD    = 0x00010000;\n+pub const VSS_VOLSNAP_ATTR_DIFFERENTIAL: ::DWORD         = 0x00020000;\n+pub const VSS_VOLSNAP_ATTR_PLEX: ::DWORD                 = 0x00040000;\n+pub const VSS_VOLSNAP_ATTR_IMPORTED: ::DWORD             = 0x00080000;\n+pub const VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY: ::DWORD      = 0x00100000;\n+pub const VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY: ::DWORD     = 0x00200000;\n+pub const VSS_VOLSNAP_ATTR_AUTORECOVER: ::DWORD          = 0x00400000;\n+pub const VSS_VOLSNAP_ATTR_ROLLBACK_RECOVERY: ::DWORD    = 0x00800000;\n+pub const VSS_VOLSNAP_ATTR_DELAYED_POSTSNAPSHOT: ::DWORD = 0x01000000;\n+pub const VSS_VOLSNAP_ATTR_TXF_RECOVERY: ::DWORD         = 0x02000000;\n+pub const VSS_VOLSNAP_ATTR_FILE_SHARE: ::DWORD           = 0x04000000;\n+\n+pub type VSS_SNAPSHOT_CONTEXT = ::DWORD;\n+pub type PVSS_SNAPSHOT_CONTEXT = *mut VSS_SNAPSHOT_CONTEXT;\n+pub const VSS_CTX_BACKUP: ::DWORD                    = 0;\n+pub const VSS_CTX_FILE_SHARE_BACKUP: ::DWORD         = VSS_VOLSNAP_ATTR_NO_WRITERS;\n+pub const VSS_CTX_NAS_ROLLBACK: ::DWORD              = ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS );\n+pub const VSS_CTX_APP_ROLLBACK: ::DWORD              = ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE );\n+pub const VSS_CTX_CLIENT_ACCESSIBLE: ::DWORD         = ( ( ( VSS_VOLSNAP_ATTR_PERSISTENT | VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE ) | VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE ) | VSS_VOLSNAP_ATTR_NO_WRITERS );","path":"src/vss.rs","position":61,"original_position":61,"commit_id":"f21ae308167a61c1265452ac89bc86b8bc65e4cb","original_commit_id":"f21ae308167a61c1265452ac89bc86b8bc65e4cb","user":{"login":"retep998","id":666308,"avatar_url":"https://avatars.githubusercontent.com/u/666308?v=3","gravatar_id":"","url":"https://api.github.com/users/retep998","html_url":"https://github.com/retep998","followers_url":"https://api.github.com/users/retep998/followers","following_url":"https://api.github.com/users/retep998/following{/other_user}","gists_url":"https://api.github.com/users/retep998/gists{/gist_id}","starred_url":"https://api.github.com/users/retep998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retep998/subscriptions","organizations_url":"https://api.github.com/users/retep998/orgs","repos_url":"https://api.github.com/users/retep998/repos","events_url":"https://api.github.com/users/retep998/events{/privacy}","received_events_url":"https://api.github.com/users/retep998/received_events","type":"User","site_admin":false},"body":"No need for all these parentheses. Also use line breaks to fit within 99 columns.","created_at":"2015-06-20T22:35:05Z","updated_at":"2015-06-20T22:35:05Z","html_url":"https://github.com/retep998/winapi-rs/pull/114#discussion_r32888818","pull_request_url":"https://api.github.com/repos/retep998/winapi-rs/pulls/114","_links":{"self":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/comments/32888818"},"html":{"href":"https://github.com/retep998/winapi-rs/pull/114#discussion_r32888818"},"pull_request":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/114"}}},"pull_request":{"url":"https://api.github.com/repos/retep998/winapi-rs/pulls/114","id":38175173,"html_url":"https://github.com/retep998/winapi-rs/pull/114","diff_url":"https://github.com/retep998/winapi-rs/pull/114.diff","patch_url":"https://github.com/retep998/winapi-rs/pull/114.patch","issue_url":"https://api.github.com/repos/retep998/winapi-rs/issues/114","number":114,"state":"open","locked":false,"title":"Add basic vssapi support","user":{"login":"bvinc83","id":12972641,"avatar_url":"https://avatars.githubusercontent.com/u/12972641?v=3","gravatar_id":"","url":"https://api.github.com/users/bvinc83","html_url":"https://github.com/bvinc83","followers_url":"https://api.github.com/users/bvinc83/followers","following_url":"https://api.github.com/users/bvinc83/following{/other_user}","gists_url":"https://api.github.com/users/bvinc83/gists{/gist_id}","starred_url":"https://api.github.com/users/bvinc83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvinc83/subscriptions","organizations_url":"https://api.github.com/users/bvinc83/orgs","repos_url":"https://api.github.com/users/bvinc83/repos","events_url":"https://api.github.com/users/bvinc83/events{/privacy}","received_events_url":"https://api.github.com/users/bvinc83/received_events","type":"User","site_admin":false},"body":"Not all of the VSS api is finished, but at its current state, it is usable.\r\n\r\nThis lets you link statically against the microsoft vssapi.lib import library.  But this library is a bit different.  All symbols in the import library are c++ mangled names and need to be specified with the link_name attribute.  On x86_64, I would always hit rust issue 23216 and it would crash.  On x86, I had to discover the trick of starting the link_name attribute with \\x01, or else rust would further mangle the specified link_name attribute and it would fail to link.\r\n\r\nOne struct used a field named \"type\" that I had to rename \"type_\".\r\n\r\nI hit one c union that will probably need to be cleaned up later.\r\n\r\nI ran into a lot of c++ enum types.  Initially I modeled them with rust enums, but now I don't think rust enums are a good fit.  They're more cumbersome to use because they have their own namespace, and they don't let you apply the | operator to them, and about half of them are flags that need the | operator.  C++ doesn't guarantee a size of a normal enum, but from what I can tell, they're always i32 in Microsoft's ABI, right?  I settled to using INT or DWORD depending on if they were numbers or flags.  This needs more thought.  Maybe they should all be the same type, but sometimes they're negative and sometimes they're >= 2^31.\r\n","created_at":"2015-06-20T22:04:55Z","updated_at":"2015-06-20T22:35:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3d004d1b7b12a89d0a8baa4c11071cdcc06ee81","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/retep998/winapi-rs/pulls/114/commits","review_comments_url":"https://api.github.com/repos/retep998/winapi-rs/pulls/114/comments","review_comment_url":"https://api.github.com/repos/retep998/winapi-rs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/retep998/winapi-rs/issues/114/comments","statuses_url":"https://api.github.com/repos/retep998/winapi-rs/statuses/f21ae308167a61c1265452ac89bc86b8bc65e4cb","head":{"label":"bvinc83:vss","ref":"vss","sha":"f21ae308167a61c1265452ac89bc86b8bc65e4cb","user":{"login":"bvinc83","id":12972641,"avatar_url":"https://avatars.githubusercontent.com/u/12972641?v=3","gravatar_id":"","url":"https://api.github.com/users/bvinc83","html_url":"https://github.com/bvinc83","followers_url":"https://api.github.com/users/bvinc83/followers","following_url":"https://api.github.com/users/bvinc83/following{/other_user}","gists_url":"https://api.github.com/users/bvinc83/gists{/gist_id}","starred_url":"https://api.github.com/users/bvinc83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvinc83/subscriptions","organizations_url":"https://api.github.com/users/bvinc83/orgs","repos_url":"https://api.github.com/users/bvinc83/repos","events_url":"https://api.github.com/users/bvinc83/events{/privacy}","received_events_url":"https://api.github.com/users/bvinc83/received_events","type":"User","site_admin":false},"repo":{"id":37748742,"name":"winapi-rs","full_name":"bvinc83/winapi-rs","owner":{"login":"bvinc83","id":12972641,"avatar_url":"https://avatars.githubusercontent.com/u/12972641?v=3","gravatar_id":"","url":"https://api.github.com/users/bvinc83","html_url":"https://github.com/bvinc83","followers_url":"https://api.github.com/users/bvinc83/followers","following_url":"https://api.github.com/users/bvinc83/following{/other_user}","gists_url":"https://api.github.com/users/bvinc83/gists{/gist_id}","starred_url":"https://api.github.com/users/bvinc83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvinc83/subscriptions","organizations_url":"https://api.github.com/users/bvinc83/orgs","repos_url":"https://api.github.com/users/bvinc83/repos","events_url":"https://api.github.com/users/bvinc83/events{/privacy}","received_events_url":"https://api.github.com/users/bvinc83/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bvinc83/winapi-rs","description":"Rust types and constants for WinAPI bindings","fork":true,"url":"https://api.github.com/repos/bvinc83/winapi-rs","forks_url":"https://api.github.com/repos/bvinc83/winapi-rs/forks","keys_url":"https://api.github.com/repos/bvinc83/winapi-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bvinc83/winapi-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bvinc83/winapi-rs/teams","hooks_url":"https://api.github.com/repos/bvinc83/winapi-rs/hooks","issue_events_url":"https://api.github.com/repos/bvinc83/winapi-rs/issues/events{/number}","events_url":"https://api.github.com/repos/bvinc83/winapi-rs/events","assignees_url":"https://api.github.com/repos/bvinc83/winapi-rs/assignees{/user}","branches_url":"https://api.github.com/repos/bvinc83/winapi-rs/branches{/branch}","tags_url":"https://api.github.com/repos/bvinc83/winapi-rs/tags","blobs_url":"https://api.github.com/repos/bvinc83/winapi-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bvinc83/winapi-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bvinc83/winapi-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bvinc83/winapi-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bvinc83/winapi-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/bvinc83/winapi-rs/languages","stargazers_url":"https://api.github.com/repos/bvinc83/winapi-rs/stargazers","contributors_url":"https://api.github.com/repos/bvinc83/winapi-rs/contributors","subscribers_url":"https://api.github.com/repos/bvinc83/winapi-rs/subscribers","subscription_url":"https://api.github.com/repos/bvinc83/winapi-rs/subscription","commits_url":"https://api.github.com/repos/bvinc83/winapi-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bvinc83/winapi-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bvinc83/winapi-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bvinc83/winapi-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bvinc83/winapi-rs/contents/{+path}","compare_url":"https://api.github.com/repos/bvinc83/winapi-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bvinc83/winapi-rs/merges","archive_url":"https://api.github.com/repos/bvinc83/winapi-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bvinc83/winapi-rs/downloads","issues_url":"https://api.github.com/repos/bvinc83/winapi-rs/issues{/number}","pulls_url":"https://api.github.com/repos/bvinc83/winapi-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/bvinc83/winapi-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/bvinc83/winapi-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bvinc83/winapi-rs/labels{/name}","releases_url":"https://api.github.com/repos/bvinc83/winapi-rs/releases{/id}","created_at":"2015-06-19T22:23:09Z","updated_at":"2015-06-19T22:23:10Z","pushed_at":"2015-06-20T21:59:40Z","git_url":"git://github.com/bvinc83/winapi-rs.git","ssh_url":"git@github.com:bvinc83/winapi-rs.git","clone_url":"https://github.com/bvinc83/winapi-rs.git","svn_url":"https://github.com/bvinc83/winapi-rs","homepage":"https://crates.io/crates/winapi","size":1431,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"retep998:master","ref":"master","sha":"90fa563aa59e8e0bd95acf1478e0b6d167e1d517","user":{"login":"retep998","id":666308,"avatar_url":"https://avatars.githubusercontent.com/u/666308?v=3","gravatar_id":"","url":"https://api.github.com/users/retep998","html_url":"https://github.com/retep998","followers_url":"https://api.github.com/users/retep998/followers","following_url":"https://api.github.com/users/retep998/following{/other_user}","gists_url":"https://api.github.com/users/retep998/gists{/gist_id}","starred_url":"https://api.github.com/users/retep998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retep998/subscriptions","organizations_url":"https://api.github.com/users/retep998/orgs","repos_url":"https://api.github.com/users/retep998/repos","events_url":"https://api.github.com/users/retep998/events{/privacy}","received_events_url":"https://api.github.com/users/retep998/received_events","type":"User","site_admin":false},"repo":{"id":23853482,"name":"winapi-rs","full_name":"retep998/winapi-rs","owner":{"login":"retep998","id":666308,"avatar_url":"https://avatars.githubusercontent.com/u/666308?v=3","gravatar_id":"","url":"https://api.github.com/users/retep998","html_url":"https://github.com/retep998","followers_url":"https://api.github.com/users/retep998/followers","following_url":"https://api.github.com/users/retep998/following{/other_user}","gists_url":"https://api.github.com/users/retep998/gists{/gist_id}","starred_url":"https://api.github.com/users/retep998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retep998/subscriptions","organizations_url":"https://api.github.com/users/retep998/orgs","repos_url":"https://api.github.com/users/retep998/repos","events_url":"https://api.github.com/users/retep998/events{/privacy}","received_events_url":"https://api.github.com/users/retep998/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/retep998/winapi-rs","description":"Rust types and constants for WinAPI bindings","fork":false,"url":"https://api.github.com/repos/retep998/winapi-rs","forks_url":"https://api.github.com/repos/retep998/winapi-rs/forks","keys_url":"https://api.github.com/repos/retep998/winapi-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/retep998/winapi-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/retep998/winapi-rs/teams","hooks_url":"https://api.github.com/repos/retep998/winapi-rs/hooks","issue_events_url":"https://api.github.com/repos/retep998/winapi-rs/issues/events{/number}","events_url":"https://api.github.com/repos/retep998/winapi-rs/events","assignees_url":"https://api.github.com/repos/retep998/winapi-rs/assignees{/user}","branches_url":"https://api.github.com/repos/retep998/winapi-rs/branches{/branch}","tags_url":"https://api.github.com/repos/retep998/winapi-rs/tags","blobs_url":"https://api.github.com/repos/retep998/winapi-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/retep998/winapi-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/retep998/winapi-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/retep998/winapi-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/retep998/winapi-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/retep998/winapi-rs/languages","stargazers_url":"https://api.github.com/repos/retep998/winapi-rs/stargazers","contributors_url":"https://api.github.com/repos/retep998/winapi-rs/contributors","subscribers_url":"https://api.github.com/repos/retep998/winapi-rs/subscribers","subscription_url":"https://api.github.com/repos/retep998/winapi-rs/subscription","commits_url":"https://api.github.com/repos/retep998/winapi-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/retep998/winapi-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/retep998/winapi-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/retep998/winapi-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/retep998/winapi-rs/contents/{+path}","compare_url":"https://api.github.com/repos/retep998/winapi-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/retep998/winapi-rs/merges","archive_url":"https://api.github.com/repos/retep998/winapi-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/retep998/winapi-rs/downloads","issues_url":"https://api.github.com/repos/retep998/winapi-rs/issues{/number}","pulls_url":"https://api.github.com/repos/retep998/winapi-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/retep998/winapi-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/retep998/winapi-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/retep998/winapi-rs/labels{/name}","releases_url":"https://api.github.com/repos/retep998/winapi-rs/releases{/id}","created_at":"2014-09-09T23:18:24Z","updated_at":"2015-06-20T07:52:49Z","pushed_at":"2015-06-20T22:04:55Z","git_url":"git://github.com/retep998/winapi-rs.git","ssh_url":"git@github.com:retep998/winapi-rs.git","clone_url":"https://github.com/retep998/winapi-rs.git","svn_url":"https://github.com/retep998/winapi-rs","homepage":"https://crates.io/crates/winapi","size":2276,"stargazers_count":68,"watchers_count":68,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":8,"forks":41,"open_issues":8,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/114"},"html":{"href":"https://github.com/retep998/winapi-rs/pull/114"},"issue":{"href":"https://api.github.com/repos/retep998/winapi-rs/issues/114"},"comments":{"href":"https://api.github.com/repos/retep998/winapi-rs/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/retep998/winapi-rs/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/retep998/winapi-rs/statuses/f21ae308167a61c1265452ac89bc86b8bc65e4cb"}}}}