{"action":"created","comment":{"url":"https://api.github.com/repos/reactos/reactos/pulls/comments/193804498","pull_request_review_id":126849887,"id":193804498,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzgwNDQ5OA==","diff_hunk":"@@ -0,0 +1,192 @@\n+/*\n+ * PROJECT:         ReactOS API tests\n+ * LICENSE:         LGPLv2.1+ - See COPYING.LIB in the top level directory\n+ * PURPOSE:         Test for OpenAs_RunDLL\n+ * PROGRAMMERS:     Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>\n+ */\n+\n+#include \"shelltest.h\"\n+#include <stdio.h>\n+#include <process.h>\n+\n+// OpenAs_RunDLLA\n+typedef void (WINAPI *OPENAS_RUNDLLA)(HWND, HINSTANCE, LPCSTR, int);\n+// OpenAs_RunDLLW\n+typedef void (WINAPI *OPENAS_RUNDLLW)(HWND, HINSTANCE, LPCWSTR, int);\n+\n+static OPENAS_RUNDLLA pOpenAs_RunDLLA = NULL;\n+static OPENAS_RUNDLLW pOpenAs_RunDLLW = NULL;\n+\n+struct TEST_ENTRY\n+{\n+    int         nLine;\n+    BOOL        bWide;\n+    HINSTANCE   hInst;\n+    int         nRet;\n+    BOOL        bCreateFile;\n+    LPCSTR      pszFileA;\n+    LPCWSTR     pszFileW;\n+};\n+\n+#define COUNT       5\n+#define INTERVAL    200\n+\n+#define DEATH       999\n+#define OPENED      1\n+#define NOT_OPENED  0\n+\n+#define BAD_INST   ((HINSTANCE)0xDEAD)\n+#define BAD_SZ_A   ((LPCSTR)0xDEAD)\n+#define BAD_SZ_W   ((LPCWSTR)0xDEAD)\n+\n+static const TEST_ENTRY s_TestEntries[] =\n+{\n+    // ANSI\n+    {__LINE__, FALSE, NULL, OPENED, FALSE, NULL, NULL },\n+    {__LINE__, FALSE, NULL, OPENED, FALSE, \"\", NULL },\n+    {__LINE__, FALSE, NULL, OPENED, FALSE, \"invalid file name.txt\", NULL },\n+    {__LINE__, FALSE, NULL, DEATH, FALSE, BAD_SZ_A, NULL },\n+    {__LINE__, FALSE, NULL, OPENED, TRUE, \"created file.txt\", NULL },\n+    {__LINE__, FALSE, BAD_INST, OPENED, FALSE, NULL, NULL },\n+    {__LINE__, FALSE, BAD_INST, OPENED, FALSE, \"invalid file name.txt\", NULL },\n+    {__LINE__, FALSE, BAD_INST, DEATH, FALSE, BAD_SZ_A, NULL },\n+    {__LINE__, FALSE, BAD_INST, OPENED, TRUE, \"created file.txt\", NULL },\n+    // WIDE\n+    {__LINE__, TRUE, NULL, DEATH, FALSE, NULL, NULL },\n+    {__LINE__, TRUE, NULL, OPENED, FALSE, NULL, L\"\" },\n+    {__LINE__, TRUE, NULL, OPENED, FALSE, NULL, L\"invalid file name.txt\" },\n+    {__LINE__, TRUE, NULL, DEATH, FALSE, NULL, BAD_SZ_W },\n+    {__LINE__, TRUE, NULL, OPENED, TRUE, NULL, L\"created file.txt\" },\n+    {__LINE__, TRUE, BAD_INST, DEATH, FALSE, NULL, NULL },\n+    {__LINE__, TRUE, BAD_INST, OPENED, FALSE, NULL, L\"invalid file name.txt\" },\n+    {__LINE__, TRUE, BAD_INST, DEATH, FALSE, NULL, BAD_SZ_W },\n+    {__LINE__, TRUE, BAD_INST, OPENED, TRUE, NULL, L\"created file.txt\" },\n+};\n+\n+HANDLE g_hThread = NULL;\n+INT g_nRet = 0;\n+\n+static unsigned __stdcall\n+watch_thread_proc(void *arg)\n+{\n+    for (int i = 0; i < COUNT; ++i)\n+    {\n+        Sleep(INTERVAL);\n+\n+        HWND hwnd = FindWindowA(\"#32770\", \"Open With\");\n+        if (hwnd == NULL)\n+            continue;\n+\n+        g_nRet = OPENED;\n+        PostMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDCANCEL, BN_CLICKED), 0);\n+        break;\n+    }\n+    return 0;\n+}\n+\n+static void StartWatchGUI(const TEST_ENTRY *pEntry)\n+{\n+    g_nRet = NOT_OPENED;\n+    g_hThread = (HANDLE)_beginthreadex(NULL, 0, watch_thread_proc, NULL, 0, NULL);\n+}\n+\n+static void DoEntry(const TEST_ENTRY *pEntry)\n+{\n+    _SEH2_TRY\n+    {\n+        if (pEntry->bWide)\n+        {\n+            if (pEntry->bCreateFile)\n+            {\n+                FILE *fp = _wfopen(pEntry->pszFileW, L\"wb\");\n+                ok(fp != NULL, \"Line %d: Unable to create file '%s'\\n\", pEntry->nLine, wine_dbgstr_w(pEntry->pszFileW));\n+                fclose(fp);\n+            }\n+\n+            StartWatchGUI(pEntry);\n+            SetLastError(0xDEADFACE);\n+            (*pOpenAs_RunDLLW)(NULL, pEntry->hInst, pEntry->pszFileW, SW_SHOWDEFAULT);\n+\n+            WaitForSingleObject(g_hThread, INTERVAL * COUNT);","path":"modules/rostests/apitests/shell32/OpenAs_RunDLL.cpp","position":110,"original_position":110,"commit_id":"e0b438d5691e23c1a287f71333b9e437b130607e","original_commit_id":"e0b438d5691e23c1a287f71333b9e437b130607e","user":{"login":"ThFabba","id":18138474,"node_id":"MDQ6VXNlcjE4MTM4NDc0","avatar_url":"https://avatars3.githubusercontent.com/u/18138474?v=4","gravatar_id":"","url":"https://api.github.com/users/ThFabba","html_url":"https://github.com/ThFabba","followers_url":"https://api.github.com/users/ThFabba/followers","following_url":"https://api.github.com/users/ThFabba/following{/other_user}","gists_url":"https://api.github.com/users/ThFabba/gists{/gist_id}","starred_url":"https://api.github.com/users/ThFabba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThFabba/subscriptions","organizations_url":"https://api.github.com/users/ThFabba/orgs","repos_url":"https://api.github.com/users/ThFabba/repos","events_url":"https://api.github.com/users/ThFabba/events{/privacy}","received_events_url":"https://api.github.com/users/ThFabba/received_events","type":"User","site_admin":false},"body":"An INFINITE wait would be better. Otherwise you run the risk of a race condition where you have two watcher threads active concurrently.","created_at":"2018-06-07T16:06:23Z","updated_at":"2018-06-07T16:12:18Z","html_url":"https://github.com/reactos/reactos/pull/605#discussion_r193804498","pull_request_url":"https://api.github.com/repos/reactos/reactos/pulls/605","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments/193804498"},"html":{"href":"https://github.com/reactos/reactos/pull/605#discussion_r193804498"},"pull_request":{"href":"https://api.github.com/repos/reactos/reactos/pulls/605"}}},"pull_request":{"url":"https://api.github.com/repos/reactos/reactos/pulls/605","id":193221326,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMjIxMzI2","html_url":"https://github.com/reactos/reactos/pull/605","diff_url":"https://github.com/reactos/reactos/pull/605.diff","patch_url":"https://github.com/reactos/reactos/pull/605.patch","issue_url":"https://api.github.com/repos/reactos/reactos/issues/605","number":605,"state":"open","locked":false,"title":"[SHELL32][APITESTS] Add tests of OpenAs_RunDLL","user":{"login":"katahiromz","id":2107452,"node_id":"MDQ6VXNlcjIxMDc0NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2107452?v=4","gravatar_id":"","url":"https://api.github.com/users/katahiromz","html_url":"https://github.com/katahiromz","followers_url":"https://api.github.com/users/katahiromz/followers","following_url":"https://api.github.com/users/katahiromz/following{/other_user}","gists_url":"https://api.github.com/users/katahiromz/gists{/gist_id}","starred_url":"https://api.github.com/users/katahiromz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katahiromz/subscriptions","organizations_url":"https://api.github.com/users/katahiromz/orgs","repos_url":"https://api.github.com/users/katahiromz/repos","events_url":"https://api.github.com/users/katahiromz/events{/privacy}","received_events_url":"https://api.github.com/users/katahiromz/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nThis PR will add tests of OpenAs_RunDLLA and OpenAs_RunDLLW functions in shell32.\r\n\r\n[ROSTESTS-310](https://jira.reactos.org/browse/ROSTESTS-310)","created_at":"2018-06-07T07:01:03Z","updated_at":"2018-06-07T16:12:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c6803b748f87cf18b99c610a6026c0375899885","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":893634353,"node_id":"MDU6TGFiZWw4OTM2MzQzNTM=","url":"https://api.github.com/repos/reactos/reactos/labels/ROSTESTS","name":"ROSTESTS","color":"b2d4ff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/reactos/reactos/pulls/605/commits","review_comments_url":"https://api.github.com/repos/reactos/reactos/pulls/605/comments","review_comment_url":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reactos/reactos/issues/605/comments","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/e0b438d5691e23c1a287f71333b9e437b130607e","head":{"label":"katahiromz:openas-test","ref":"openas-test","sha":"e0b438d5691e23c1a287f71333b9e437b130607e","user":{"login":"katahiromz","id":2107452,"node_id":"MDQ6VXNlcjIxMDc0NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2107452?v=4","gravatar_id":"","url":"https://api.github.com/users/katahiromz","html_url":"https://github.com/katahiromz","followers_url":"https://api.github.com/users/katahiromz/followers","following_url":"https://api.github.com/users/katahiromz/following{/other_user}","gists_url":"https://api.github.com/users/katahiromz/gists{/gist_id}","starred_url":"https://api.github.com/users/katahiromz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katahiromz/subscriptions","organizations_url":"https://api.github.com/users/katahiromz/orgs","repos_url":"https://api.github.com/users/katahiromz/repos","events_url":"https://api.github.com/users/katahiromz/events{/privacy}","received_events_url":"https://api.github.com/users/katahiromz/received_events","type":"User","site_admin":false},"repo":{"id":123541775,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM1NDE3NzU=","name":"reactos","full_name":"katahiromz/reactos","owner":{"login":"katahiromz","id":2107452,"node_id":"MDQ6VXNlcjIxMDc0NTI=","avatar_url":"https://avatars1.githubusercontent.com/u/2107452?v=4","gravatar_id":"","url":"https://api.github.com/users/katahiromz","html_url":"https://github.com/katahiromz","followers_url":"https://api.github.com/users/katahiromz/followers","following_url":"https://api.github.com/users/katahiromz/following{/other_user}","gists_url":"https://api.github.com/users/katahiromz/gists{/gist_id}","starred_url":"https://api.github.com/users/katahiromz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katahiromz/subscriptions","organizations_url":"https://api.github.com/users/katahiromz/orgs","repos_url":"https://api.github.com/users/katahiromz/repos","events_url":"https://api.github.com/users/katahiromz/events{/privacy}","received_events_url":"https://api.github.com/users/katahiromz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/katahiromz/reactos","description":"A free Windows-compatible Operating System","fork":true,"url":"https://api.github.com/repos/katahiromz/reactos","forks_url":"https://api.github.com/repos/katahiromz/reactos/forks","keys_url":"https://api.github.com/repos/katahiromz/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katahiromz/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katahiromz/reactos/teams","hooks_url":"https://api.github.com/repos/katahiromz/reactos/hooks","issue_events_url":"https://api.github.com/repos/katahiromz/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/katahiromz/reactos/events","assignees_url":"https://api.github.com/repos/katahiromz/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/katahiromz/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/katahiromz/reactos/tags","blobs_url":"https://api.github.com/repos/katahiromz/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katahiromz/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katahiromz/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/katahiromz/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katahiromz/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/katahiromz/reactos/languages","stargazers_url":"https://api.github.com/repos/katahiromz/reactos/stargazers","contributors_url":"https://api.github.com/repos/katahiromz/reactos/contributors","subscribers_url":"https://api.github.com/repos/katahiromz/reactos/subscribers","subscription_url":"https://api.github.com/repos/katahiromz/reactos/subscription","commits_url":"https://api.github.com/repos/katahiromz/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/katahiromz/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/katahiromz/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/katahiromz/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/katahiromz/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/katahiromz/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katahiromz/reactos/merges","archive_url":"https://api.github.com/repos/katahiromz/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katahiromz/reactos/downloads","issues_url":"https://api.github.com/repos/katahiromz/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/katahiromz/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/katahiromz/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/katahiromz/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katahiromz/reactos/labels{/name}","releases_url":"https://api.github.com/repos/katahiromz/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/katahiromz/reactos/deployments","created_at":"2018-03-02T06:48:58Z","updated_at":"2018-05-12T11:09:24Z","pushed_at":"2018-06-07T12:20:10Z","git_url":"git://github.com/katahiromz/reactos.git","ssh_url":"git@github.com:katahiromz/reactos.git","clone_url":"https://github.com/katahiromz/reactos.git","svn_url":"https://github.com/katahiromz/reactos","homepage":null,"size":457335,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"reactos:master","ref":"master","sha":"698cbc6184722f29389ccd75ca96d88d6cd4b010","user":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"repo":{"id":105627846,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU2Mjc4NDY=","name":"reactos","full_name":"reactos/reactos","owner":{"login":"reactos","id":1056157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNTYxNTc=","avatar_url":"https://avatars0.githubusercontent.com/u/1056157?v=4","gravatar_id":"","url":"https://api.github.com/users/reactos","html_url":"https://github.com/reactos","followers_url":"https://api.github.com/users/reactos/followers","following_url":"https://api.github.com/users/reactos/following{/other_user}","gists_url":"https://api.github.com/users/reactos/gists{/gist_id}","starred_url":"https://api.github.com/users/reactos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactos/subscriptions","organizations_url":"https://api.github.com/users/reactos/orgs","repos_url":"https://api.github.com/users/reactos/repos","events_url":"https://api.github.com/users/reactos/events{/privacy}","received_events_url":"https://api.github.com/users/reactos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reactos/reactos","description":"A free Windows-compatible Operating System","fork":false,"url":"https://api.github.com/repos/reactos/reactos","forks_url":"https://api.github.com/repos/reactos/reactos/forks","keys_url":"https://api.github.com/repos/reactos/reactos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactos/reactos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactos/reactos/teams","hooks_url":"https://api.github.com/repos/reactos/reactos/hooks","issue_events_url":"https://api.github.com/repos/reactos/reactos/issues/events{/number}","events_url":"https://api.github.com/repos/reactos/reactos/events","assignees_url":"https://api.github.com/repos/reactos/reactos/assignees{/user}","branches_url":"https://api.github.com/repos/reactos/reactos/branches{/branch}","tags_url":"https://api.github.com/repos/reactos/reactos/tags","blobs_url":"https://api.github.com/repos/reactos/reactos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactos/reactos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactos/reactos/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactos/reactos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactos/reactos/statuses/{sha}","languages_url":"https://api.github.com/repos/reactos/reactos/languages","stargazers_url":"https://api.github.com/repos/reactos/reactos/stargazers","contributors_url":"https://api.github.com/repos/reactos/reactos/contributors","subscribers_url":"https://api.github.com/repos/reactos/reactos/subscribers","subscription_url":"https://api.github.com/repos/reactos/reactos/subscription","commits_url":"https://api.github.com/repos/reactos/reactos/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactos/reactos/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactos/reactos/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactos/reactos/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactos/reactos/contents/{+path}","compare_url":"https://api.github.com/repos/reactos/reactos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactos/reactos/merges","archive_url":"https://api.github.com/repos/reactos/reactos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactos/reactos/downloads","issues_url":"https://api.github.com/repos/reactos/reactos/issues{/number}","pulls_url":"https://api.github.com/repos/reactos/reactos/pulls{/number}","milestones_url":"https://api.github.com/repos/reactos/reactos/milestones{/number}","notifications_url":"https://api.github.com/repos/reactos/reactos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactos/reactos/labels{/name}","releases_url":"https://api.github.com/repos/reactos/reactos/releases{/id}","deployments_url":"https://api.github.com/repos/reactos/reactos/deployments","created_at":"2017-10-03T08:04:52Z","updated_at":"2018-06-07T15:45:32Z","pushed_at":"2018-06-07T12:23:09Z","git_url":"git://github.com/reactos/reactos.git","ssh_url":"git@github.com:reactos/reactos.git","clone_url":"https://github.com/reactos/reactos.git","svn_url":"https://github.com/reactos/reactos","homepage":null,"size":456814,"stargazers_count":4350,"watchers_count":4350,"language":"C","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":332,"mirror_url":null,"archived":false,"open_issues_count":82,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":332,"open_issues":82,"watchers":4350,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reactos/reactos/pulls/605"},"html":{"href":"https://github.com/reactos/reactos/pull/605"},"issue":{"href":"https://api.github.com/repos/reactos/reactos/issues/605"},"comments":{"href":"https://api.github.com/repos/reactos/reactos/issues/605/comments"},"review_comments":{"href":"https://api.github.com/repos/reactos/reactos/pulls/605/comments"},"review_comment":{"href":"https://api.github.com/repos/reactos/reactos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reactos/reactos/pulls/605/commits"},"statuses":{"href":"https://api.github.com/repos/reactos/reactos/statuses/e0b438d5691e23c1a287f71333b9e437b130607e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ThFabba"}}