{"id":265570,"date":"2015-09-14T14:05:03","date_gmt":"2015-09-14T10:05:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=265570"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=265570","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 LoadLibrary() \u0438 GetProcAddress()"},"content":{"rendered":"<br \/>\n<h4>\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (DLL), \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f: \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (<i>load-time linking<\/i>) \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<i>run-time linking<\/i>). \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 API \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438) \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043d\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0435\u0440\u0442\u043e\u043a, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0441\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043c\u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u044b \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u043b\u0438\u0448\u043d\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 DLL \u0438\u0437 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (EXE), \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 (\u0447\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e) \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u043a\u043e\u0434\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u0442\u043e\u0433\u043e Win32 API \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a (\u043f\u0440\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u044d\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 MSDN):<\/p>\n<pre><code>typedef int (__cdecl *some_proc_t)(LPWSTR);  HINSTANCE hlib = LoadLibrary(_T(&quot;some.dll&quot;)); myproc_t proc_addr = NULL; int result = -1;  if (hlib) {     proc_addr = (some_proc_t) GetProcAddress(hlib, &quot;SomeProcName&quot;);     if (proc_addr) {         result = proc_addr(L&quot;send some string to DLL function&quot;);         printf(&quot;Successfully called DLL procedure with result %d&quot;, result);     }     FreeLibrary(&quot;some.dll&quot;); } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u044d\u0442\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code>ntprocedure&lt;int(LPWSTR)&gt; some_proc_(&quot;SomeProcName&quot;, _T(&quot;some.dll&quot;)); try {     int result = some_proc_(L&quot;send some string to DLL function&quot;);     printf(&quot;Successfully called DLL procedure with result %d&quot;, result); } catch (...) {     printf(&quot;Failed to call DLL procedure&quot;); } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430, \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <b>ntprocedure<\/b> \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0438\u043f\u0443 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0435\u0451 \u0438\u043c\u044f \u0438 \u0438\u043c\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0435\u0440\u0442\u043a\u0438, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0433\u043a\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0439 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b common.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#pragma once  #include &quot;tchar.h&quot; #include &lt;string&gt;  #define NS_BEGIN_(A) namespace A { #define NS_BEGIN_A_ namespace { #define NS_END_ }  #define NO_EXCEPT_ throw() #define THROW_(E) throw(E)  #define PROHIBITED_ = delete  \/\/============================================================================= typedef std::basic_string&lt;   TCHAR, std::char_traits&lt;TCHAR&gt;, std::allocator&lt;TCHAR&gt; &gt; tstring; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u0443\u043c\u0430\u0435\u043c \u043d\u0430\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u0435\u043b \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u0442\u043e\u0447\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0438 \u043c\u043e\u0433 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u043c \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0442\u043e\u0440. \u0410\u0432\u0442\u043e\u0440\u044b \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0442\u043e\u0440\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0447\u0438\u0441\u043b\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043b\u0438\u0431\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0414\u0435\u043b\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 C++11 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c:<\/p>\n<pre><code>R operator () (Args ... args) <\/code><\/pre>\n<p>  \u0412 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 <b>T<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0430 <b>address<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0435\u0435 \u0430\u0434\u0440\u0435\u0441, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440:<\/p>\n<pre><code>operator T() {     return reinterpret_cast&lt;T&gt;(address); } <\/code><\/pre>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u00abntprocedure.h\u00bb.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b ntprocedure.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#pragma once  #include &quot;common.h&quot;  #include &lt;memory&gt; #include &lt;string&gt; #include &lt;type_traits&gt;  NS_BEGIN_(ntutils) NS_BEGIN_(detail)  class ntmodule;  class ntprocedure_base {    ntprocedure_base(const ntprocedure_base&) PROHIBITED_;   void operator=(const ntprocedure_base&) PROHIBITED_;  public:    ntprocedure_base(const std::string& a_proc_name, const tstring& a_lib_name);   \/\/ Constructor.    virtual ~ntprocedure_base() = 0;   \/\/ Destructor.    FARPROC WINAPI address();   \/\/ Get the procedure address.    const std::string& name() const;   \/\/ Get the procedure name.  private:    std::string m_name;   std::shared_ptr&lt;ntmodule&gt; m_module; };  NS_END_  template&lt;typename T&gt; class ntprocedure : public detail::ntprocedure_base { public:    typedef typename std::remove_pointer&lt;T&gt;::type callable_t;   typedef callable_t *callable_ptr_t;    ntprocedure(const std::string& a_proc_name, const tstring& a_lib_name)   : ntprocedure_base(a_proc_name, a_lib_name),     m_function(nullptr)   {       }   \/\/ Constructor.    virtual ~ntprocedure()   {   }   \/\/ Destructor.    operator callable_ptr_t()   {     if (!m_function) {       m_function = reinterpret_cast&lt;callable_ptr_t&gt;(address());     }      return m_function;   }   \/\/ Return stored function to invoke.  private:    callable_ptr_t m_function;     };  NS_END_ <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0430\u0440\u0430 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u2014 \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <b>m_function<\/b> \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>ntmodule<\/b>. \u041d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <b>shared_ptr<\/b> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0441\u043b\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b ntmodule.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#pragma once  #include &quot;common.h&quot; #include &quot;resource_ptr.h&quot;  #include &lt;list&gt; #include &lt;memory&gt;  NS_BEGIN_(ntutils) NS_BEGIN_(detail)  class ntmodule : public std::enable_shared_from_this&lt;ntmodule&gt; {    ntmodule(const ntmodule&) PROHIBITED_;   void operator=(const ntmodule&) PROHIBITED_;  public:    typedef std::list&lt;ntmodule*&gt; container_t;    ntmodule(const tstring& a_name);   \/\/ Constructor.    ~ntmodule();   \/\/ Destructor.    const tstring& name() const;   \/\/ Get the module name.          FARPROC WINAPI address(const std::string& a_name);   \/\/ Get the procedure address.    std::shared_ptr&lt;ntmodule&gt; share();   \/\/ Share this object.    static container_t& cached();   \/\/ Return the reference to the cache.  private:    tstring m_name;   hmodule_ptr m_handle; };  NS_END_ NS_END_ <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 ntmodule:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b ntmodule.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#include &quot;stdafx.h&quot; #include &quot;ntmodule.h&quot;  #include &quot;ntprocedure.h&quot; #include &lt;cassert&gt; #include &lt;exception&gt;  ntutils::detail::ntmodule::ntmodule(const tstring& a_name) : m_name(a_name) {   assert(!a_name.empty());    cached().push_back(this); }  ntutils::detail::ntmodule::~ntmodule() {   cached().remove(this); }  const tstring& ntutils::detail::ntmodule::name() const {   return m_name; }  FARPROC WINAPI ntutils::detail::ntmodule::address(   const std::string& a_name ) {   assert(!a_name.empty());    if (!m_handle) {     m_handle.reset(::LoadLibrary(m_name.c_str()));       }    if (!m_handle) {     std::string err(&quot;LoadLibrary failed&quot;);     throw std::runtime_error(err);   }    return m_handle ? ::GetProcAddress(m_handle, a_name.c_str()) : 0; }  std::shared_ptr&lt;ntutils::detail::ntmodule&gt; ntutils::detail::ntmodule::share() {   return shared_from_this(); }  ntutils::detail::ntmodule::container_t& ntutils::detail::ntmodule::cached() {   static container_t* modules = new container_t;   return *modules; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435. \u042d\u0442\u0438\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 <b>ntmodule<\/b> \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u0430 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0435\u0433\u043e. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 ntprocedure.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b ntprocedure.cpp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#include &quot;stdafx.h&quot;  #include &quot;ntmodule.h&quot; #include &quot;ntprocedure.h&quot;  #include &lt;cassert&gt; #include &lt;exception&gt;  ntutils::detail::ntprocedure_base::ntprocedure_base(   const std::string& a_proc_name, const tstring& a_lib_name ) : m_name(a_proc_name),   m_module(nullptr) {   assert(!a_proc_name.empty());   assert(!a_lib_name.empty());    for (auto module : ntmodule::cached()) {     \/\/ Perform case insensitive comparison:     if (!lstrcmpi(module-&gt;name().c_str(), a_lib_name.c_str())) {       m_module = module-&gt;share();       break;     }   }    if (!m_module) {     m_module = std::make_shared&lt;ntmodule&gt;(a_lib_name);   } }  ntutils::detail::ntprocedure_base::~ntprocedure_base() { }  FARPROC WINAPI ntutils::detail::ntprocedure_base::address() {   FARPROC addr = m_module-&gt;address(m_name);   if (!addr) {     std::string err(&quot;GetProcAddress failed&quot;);       throw std::runtime_error(err);   }    return addr; }  const std::string& ntutils::detail::ntprocedure_base::name() const {   return m_name; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 <b>ntprocedure_base<\/b> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0438\u0441\u043a \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430\u0439\u0434\u0435\u043d, \u0442\u043e \u0432\u044b\u0437\u043e\u0432 module-&gt;<i>share()<\/i> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u0436\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0435\u0449\u0435 \u043d\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c <i>LoadLibrary()<\/i>, \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>GetModuleHandle()<\/i> \u0438 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c <b>shared_ptr<\/b>. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b <i>LoadLibrary()<\/i> \u0438 <i>FreeLibrary()<\/i>.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0410\u0445, \u0434\u0430, \u0432 \u043a\u043e\u0434\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0438\u043f <b>resouce_ptr<\/b>. \u042d\u0442\u043e \u043d\u0438\u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a RAII-\u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u0442\u0430\u043a\u0438\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u043a\u0430\u043a HANDLE, HMODULE \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u043d\u043e, \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0430\u0439\u043b resource_ptr.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>#pragma once  #include &quot;common.h&quot; #include &quot;windows.h&quot;  #include &lt;cassert&gt; #include &lt;memory&gt;  NS_BEGIN_(ntutils)  template&lt;typename HTag_&gt; struct resource_close {   void operator()(typename HTag_::handle_t) const NO_EXCEPT_; };  struct handle_tag {   typedef HANDLE resource_t; };  struct hmodule_tag {   typedef HMODULE resource_t; };  template&lt;&gt; struct resource_close&lt;handle_tag&gt; {      void operator()(handle_tag::resource_t a_handle) const NO_EXCEPT_   {     bool status = !!::CloseHandle(a_handle);     assert(status);   }  };  template&lt;&gt; struct resource_close&lt;hmodule_tag&gt; {    void operator()(hmodule_tag::resource_t a_handle) const NO_EXCEPT_   {     bool status = !!::FreeLibrary(a_handle);     assert(status);   }  };  template&lt;   typename RTag_,   typename RTag_::resource_t RInvalid_,   typename RFree_ = resource_close&lt;RTag_&gt; &gt; class resource_ptr {    typedef typename RTag_::resource_t resource_t;   typedef RFree_ deletor_t;    resource_ptr(const resource_ptr&) PROHIBITED_;   void operator=(const resource_ptr&) PROHIBITED_;  public:    resource_ptr() NO_EXCEPT_   : m_resource(RInvalid_)   {   }   resource_ptr(resource_t a_resource) NO_EXCEPT_   : m_resource(a_resource)   {     }   \/\/ Constructor.    explicit operator bool() const NO_EXCEPT_   {     return m_resource && m_resource != RInvalid_;   }   \/\/ Operator bool().    operator const resource_t&() const NO_EXCEPT_   {     return m_resource;   }   \/\/ Get the stored handle value.    void reset(resource_t a_resource = resource_t()) NO_EXCEPT_   {     resource_t old = m_resource;     m_resource = a_resource;     if (old != resource_t() && old != RInvalid_) {       m_deletor(old);     }   }    ~resource_ptr() NO_EXCEPT_   {     if (m_resource != resource_t() && m_resource != RInvalid_) {       m_deletor(m_resource);     }   }   \/\/ Destructor.  private:    resource_t m_resource;   deletor_t m_deletor; };  typedef resource_ptr&lt;handle_tag, INVALID_HANDLE_VALUE&gt; handle_ptr; typedef resource_ptr&lt;hmodule_tag, NULL&gt; hmodule_ptr;  NS_END_ <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0442\u043e\u0447\u043d\u043e \u0432\u0441\u0435. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438!       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/266809\/\"> http:\/\/habrahabr.ru\/post\/266809\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h4>\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (DLL), \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f: \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (<i>load-time linking<\/i>) \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<i>run-time linking<\/i>). \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 API \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438) \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043d\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0435\u0440\u0442\u043e\u043a, \u043d\u043e, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432\u0441\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043c\u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u044b \u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u043b\u0438\u0448\u043d\u0438\u043c \u043a\u043e\u0434\u043e\u043c. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 DLL \u0438\u0437 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (EXE), \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 (\u0447\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e) \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u043c \u043a\u043e\u0434\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-265570","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265570"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265570\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}